Misc changes (#882)

This commit is contained in:
vvb2060 2021-08-11 12:45:29 +08:00 committed by GitHub
parent bf969cfc5f
commit 00e8c69ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 7 deletions

View File

@ -58,8 +58,8 @@ public final class ModuleUtil {
public static synchronized ModuleUtil getInstance() {
if (instance == null) {
instance = new ModuleUtil();
}
instance.reloadInstalledModules();
}
return instance;
}

View File

@ -22,7 +22,7 @@ abstract public class ApplicationServiceClient implements ILSPApplicationService
abstract public boolean isResourcesHookEnabled();
@Override
abstract public List getModulesList(String processName);
abstract public List<Module> getModulesList(String processName);
abstract public List<Module> getModulesList();

View File

@ -478,10 +478,8 @@ public class ConfigManager {
var path = apkPath;
if (!new File(path).exists()) {
path = getModuleApkPath(pkgInfo.applicationInfo);
if (path == null)
obsoleteModules.add(packageName);
else
obsoletePaths.put(packageName, path);
if (path == null) obsoleteModules.add(packageName);
else obsoletePaths.put(packageName, path);
}
var file = loadModule(path);
if (file == null) {
@ -679,13 +677,14 @@ public class ConfigManager {
}
}
@Nullable
public String getModuleApkPath(ApplicationInfo info) {
String[] apks;
if (info.splitSourceDirs != null) {
apks = Arrays.copyOf(info.splitSourceDirs, info.splitSourceDirs.length + 1);
apks[info.splitSourceDirs.length] = info.sourceDir;
} else apks = new String[]{info.sourceDir};
var apkPath = Arrays.stream(apks).filter(apk -> {
var apkPath = Arrays.stream(apks).parallel().filter(apk -> {
try (var zip = new ZipFile(apk)) {
return zip.getEntry("assets/xposed_init") != null;
} catch (IOException e) {