Update xposed module metadata parsing (#558)
* Stop read xposedmodule
Official documentation requires `xposedmodule` value is `true`, but in the previous implementation there was no judgment on what the value was, even if `false`. So, remove it and use `xposedminversion` to determine if the app is an xposed module.
* xposedscope supports string
```xml
<meta-data
android:name="xposedscope"
android:value="com.example.app1;com.example.app2" />
```
This commit is contained in:
parent
fb0db916fa
commit
7a35906cb6
|
|
@ -164,7 +164,7 @@ public class ScopeAdapter extends RecyclerView.Adapter<ScopeAdapter.ViewHolder>
|
|||
return false;
|
||||
}
|
||||
if (preferences.getBoolean("filter_modules", true)) {
|
||||
if (info.applicationInfo.metaData != null && info.applicationInfo.metaData.containsKey("xposedmodule")) {
|
||||
if (info.applicationInfo.metaData != null && info.applicationInfo.metaData.containsKey("xposedminversion")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public final class ModuleUtil {
|
|||
if (!app.enabled || app.uid / 100000 != 0)
|
||||
continue;
|
||||
|
||||
if (app.metaData != null && app.metaData.containsKey("xposedmodule")) {
|
||||
if (app.metaData != null && app.metaData.containsKey("xposedminversion")) {
|
||||
InstalledModule installed = new InstalledModule(pkg, false);
|
||||
modules.put(pkg.packageName, installed);
|
||||
}
|
||||
|
|
@ -119,7 +119,7 @@ public final class ModuleUtil {
|
|||
}
|
||||
|
||||
ApplicationInfo app = pkg.applicationInfo;
|
||||
if (app.enabled && app.metaData != null && app.metaData.containsKey("xposedmodule")) {
|
||||
if (app.enabled && app.metaData != null && app.metaData.containsKey("xposedminversion")) {
|
||||
InstalledModule module = new InstalledModule(pkg, false);
|
||||
installedModules.put(packageName, module);
|
||||
for (ModuleListener listener : listeners) {
|
||||
|
|
@ -262,6 +262,10 @@ public final class ModuleUtil {
|
|||
int scopeListResourceId = app.metaData.getInt("xposedscope");
|
||||
if (scopeListResourceId != 0) {
|
||||
scopeList = Arrays.asList(pm.getResourcesForApplication(app).getStringArray(scopeListResourceId));
|
||||
} else {
|
||||
String scopeListString = app.metaData.getString("xposedscope");
|
||||
if (scopeListString != null)
|
||||
scopeList = Arrays.asList(scopeListString.split(";"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
Loading…
Reference in New Issue