[core] Add missing component filter (#602)
This commit is contained in:
parent
418b80a63a
commit
dc8deae175
|
|
@ -23,6 +23,7 @@ import static org.lsposed.lspd.service.ServiceManager.TAG;
|
|||
|
||||
import android.content.ContentValues;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteStatement;
|
||||
|
|
@ -314,7 +315,7 @@ public class ConfigManager {
|
|||
while (cursor.moveToNext()) {
|
||||
String packageName = cursor.getString(pkgNameIdx);
|
||||
try {
|
||||
PackageInfo pkgInfo = PackageService.getPackageInfoFromAllUsers(packageName, 0);
|
||||
PackageInfo pkgInfo = PackageService.getPackageInfoFromAllUsers(packageName, PackageManager.MATCH_DISABLED_COMPONENTS | PackageManager.MATCH_UNINSTALLED_PACKAGES);
|
||||
if (pkgInfo != null && pkgInfo.applicationInfo != null) {
|
||||
cachedModule.put(pkgInfo.applicationInfo.uid % PER_USER_RANGE, pkgInfo.packageName);
|
||||
} else {
|
||||
|
|
@ -552,13 +553,6 @@ public class ConfigManager {
|
|||
return true;
|
||||
}
|
||||
|
||||
public void uninstalledApp(Application app) {
|
||||
if (removeAppWithoutCache(app)) {
|
||||
// Called by oneway binder
|
||||
cacheScopes();
|
||||
}
|
||||
}
|
||||
|
||||
public void updateAppCache() {
|
||||
// Called by oneway binder
|
||||
cacheScopes();
|
||||
|
|
|
|||
|
|
@ -95,6 +95,12 @@ public class LSPosedService extends ILSPosedService.Stub {
|
|||
break;
|
||||
}
|
||||
case Intent.ACTION_PACKAGE_CHANGED: {
|
||||
// make sure that the change is for the complete package, not only a
|
||||
// component
|
||||
String[] components = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_COMPONENT_NAME_LIST);
|
||||
if (components != null && !Arrays.stream(components).reduce(false, (p, c) -> p || c.equals(moduleName), Boolean::logicalOr)) {
|
||||
return;
|
||||
}
|
||||
// when package is changed, we may need to update cache (module cache or process cache)
|
||||
if (isXposedModule) {
|
||||
ConfigManager.getInstance().updateModuleApkPath(moduleName, applicationInfo.sourceDir);
|
||||
|
|
|
|||
Loading…
Reference in New Issue