Do not broadcast when module path not changed (#1622)

This commit is contained in:
LoveSy 2022-02-04 01:53:48 +08:00 committed by GitHub
parent 4955dcb542
commit 4bcf7718ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -705,7 +705,7 @@ public class ConfigManager {
updateCaches(true); updateCaches(true);
return true; return true;
} }
return count >= 0; return count > 0;
} }
// Only be called before updating modules. No need to cache. // Only be called before updating modules. No need to cache.

View File

@ -119,18 +119,17 @@ public class LSPosedService extends ILSPosedService.Stub {
if (components != null && !Arrays.stream(components).reduce(false, (p, c) -> p || c.equals(moduleName), Boolean::logicalOr)) { if (components != null && !Arrays.stream(components).reduce(false, (p, c) -> p || c.equals(moduleName), Boolean::logicalOr)) {
return; return;
} }
broadcastAndShowNotification(moduleName, userId, intent, isXposedModule);
if (isXposedModule) { if (isXposedModule) {
// When installing a new Xposed module, we update the apk path to mark it as a // When installing a new Xposed module, we update the apk path to mark it as a
// module to send a broadcast when modules that have not been activated are // module to send a broadcast when modules that have not been activated are
// uninstalled. // uninstalled.
ConfigManager.getInstance().updateModuleApkPath(moduleName, ConfigManager.getInstance().getModuleApkPath(applicationInfo), true); // If cache not updated, assume it's not xposed module
// when package is changed, we may need to update cache (module cache or process cache) isXposedModule = ConfigManager.getInstance().updateModuleApkPath(moduleName, ConfigManager.getInstance().getModuleApkPath(applicationInfo), false);
ConfigManager.getInstance().updateCache();
} else if (ConfigManager.getInstance().isUidHooked(uid)) { } else if (ConfigManager.getInstance().isUidHooked(uid)) {
// it will automatically remove obsolete app from database // it will automatically remove obsolete app from database
ConfigManager.getInstance().updateAppCache(); ConfigManager.getInstance().updateAppCache();
} }
broadcastAndShowNotification(moduleName, userId, intent, isXposedModule);
break; break;
} }
case Intent.ACTION_UID_REMOVED: { case Intent.ACTION_UID_REMOVED: {