[core] Fix apk path not updated again (#961)

This commit is contained in:
LoveSy 2021-08-21 00:57:39 +08:00 committed by GitHub
parent 904b8ec6a2
commit ee9de79eb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 8 deletions

View File

@ -467,6 +467,7 @@ public class ConfigManager {
if (oldModule != null && if (oldModule != null &&
pkgInfo.applicationInfo.sourceDir != null && pkgInfo.applicationInfo.sourceDir != null &&
apkPath != null && oldModule.apkPath != null && apkPath != null && oldModule.apkPath != null &&
existsInGlobalNamespace(apkPath) &&
Objects.equals(apkPath, oldModule.apkPath) && Objects.equals(apkPath, oldModule.apkPath) &&
Objects.equals(new File(pkgInfo.applicationInfo.sourceDir).getParent(), new File(apkPath).getParent())) { Objects.equals(new File(pkgInfo.applicationInfo.sourceDir).getParent(), new File(apkPath).getParent())) {
if (oldModule.appId != -1) { if (oldModule.appId != -1) {
@ -477,20 +478,17 @@ public class ConfigManager {
} }
continue; continue;
} }
var path = apkPath; apkPath = getModuleApkPath(pkgInfo.applicationInfo);
if (path == null || !existsInGlobalNamespace(path)) { if (apkPath == null) obsoleteModules.add(packageName);
path = getModuleApkPath(pkgInfo.applicationInfo); else obsoletePaths.put(packageName, apkPath);
if (path == null) obsoleteModules.add(packageName); var file = loadModule(apkPath);
else obsoletePaths.put(packageName, path);
}
var file = loadModule(path);
if (file == null) { if (file == null) {
Log.w(TAG, "failed to load module " + packageName); Log.w(TAG, "failed to load module " + packageName);
obsoleteModules.add(packageName); obsoleteModules.add(packageName);
continue; continue;
} }
var module = new Module(); var module = new Module();
module.apkPath = path; module.apkPath = apkPath;
module.packageName = packageName; module.packageName = packageName;
module.file = file; module.file = file;
module.appId = pkgInfo.applicationInfo.uid; module.appId = pkgInfo.applicationInfo.uid;