Fix embed strategy

This commit is contained in:
LoveSy 2021-06-22 01:49:08 +08:00
parent ce39256f3c
commit 2e53bf7ec5
1 changed files with 4 additions and 8 deletions

View File

@ -154,12 +154,9 @@ public class LSPApplication extends ApplicationServiceClient {
var name = module.optString("name"); var name = module.optString("name");
var enabled = module.optBoolean("enabled", true); var enabled = module.optBoolean("enabled", true);
var useEmbed = module.optBoolean("use_embed", false); var useEmbed = module.optBoolean("use_embed", false);
var apk = module.optString("path"); if (name.isEmpty()) continue;
if (!enabled) disabled_modules.add(name); if (!enabled) disabled_modules.add(name);
if (embedded_modules.contains(name) && useEmbed) continue; if (embedded_modules.contains(name) && !useEmbed) embedded_modules.remove(name);
if (apk.isEmpty() || name.isEmpty()) continue;
if (!new File(apk).exists()) continue;
LSPApplication.modules.put(name, apk);
} }
for (PackageInfo pkg : context.getPackageManager().getInstalledPackages(PackageManager.GET_META_DATA)) { for (PackageInfo pkg : context.getPackageManager().getInstalledPackages(PackageManager.GET_META_DATA)) {
@ -167,8 +164,8 @@ public class LSPApplication extends ApplicationServiceClient {
if (!app.enabled) { if (!app.enabled) {
continue; continue;
} }
if (app.metaData != null && app.metaData.containsKey("xposedminversion")) { if (app.metaData != null && app.metaData.containsKey("xposedminversion") && !embedded_modules.contains(app.packageName)) {
LSPApplication.modules.computeIfAbsent(app.packageName, k -> app.publicSourceDir); LSPApplication.modules.put(app.packageName, app.publicSourceDir);
} }
} }
final var new_modules = new JSONArray(); final var new_modules = new JSONArray();
@ -194,7 +191,6 @@ public class LSPApplication extends ApplicationServiceClient {
for (var module : disabled_modules) { for (var module : disabled_modules) {
LSPApplication.modules.remove(module); LSPApplication.modules.remove(module);
} }
Log.e(TAG, "DONE LOAD");
} }
public LSPApplication() { public LSPApplication() {