[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.ContentValues;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
import android.database.sqlite.SQLiteStatement;
|
import android.database.sqlite.SQLiteStatement;
|
||||||
|
|
@ -314,7 +315,7 @@ public class ConfigManager {
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
String packageName = cursor.getString(pkgNameIdx);
|
String packageName = cursor.getString(pkgNameIdx);
|
||||||
try {
|
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) {
|
if (pkgInfo != null && pkgInfo.applicationInfo != null) {
|
||||||
cachedModule.put(pkgInfo.applicationInfo.uid % PER_USER_RANGE, pkgInfo.packageName);
|
cachedModule.put(pkgInfo.applicationInfo.uid % PER_USER_RANGE, pkgInfo.packageName);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -552,13 +553,6 @@ public class ConfigManager {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void uninstalledApp(Application app) {
|
|
||||||
if (removeAppWithoutCache(app)) {
|
|
||||||
// Called by oneway binder
|
|
||||||
cacheScopes();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateAppCache() {
|
public void updateAppCache() {
|
||||||
// Called by oneway binder
|
// Called by oneway binder
|
||||||
cacheScopes();
|
cacheScopes();
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,12 @@ public class LSPosedService extends ILSPosedService.Stub {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Intent.ACTION_PACKAGE_CHANGED: {
|
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)
|
// when package is changed, we may need to update cache (module cache or process cache)
|
||||||
if (isXposedModule) {
|
if (isXposedModule) {
|
||||||
ConfigManager.getInstance().updateModuleApkPath(moduleName, applicationInfo.sourceDir);
|
ConfigManager.getInstance().updateModuleApkPath(moduleName, applicationInfo.sourceDir);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue