Misc changes (#882)
This commit is contained in:
parent
bf969cfc5f
commit
00e8c69ad1
|
|
@ -58,8 +58,8 @@ public final class ModuleUtil {
|
||||||
public static synchronized ModuleUtil getInstance() {
|
public static synchronized ModuleUtil getInstance() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new ModuleUtil();
|
instance = new ModuleUtil();
|
||||||
|
instance.reloadInstalledModules();
|
||||||
}
|
}
|
||||||
instance.reloadInstalledModules();
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ abstract public class ApplicationServiceClient implements ILSPApplicationService
|
||||||
abstract public boolean isResourcesHookEnabled();
|
abstract public boolean isResourcesHookEnabled();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
abstract public List getModulesList(String processName);
|
abstract public List<Module> getModulesList(String processName);
|
||||||
|
|
||||||
abstract public List<Module> getModulesList();
|
abstract public List<Module> getModulesList();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -478,10 +478,8 @@ public class ConfigManager {
|
||||||
var path = apkPath;
|
var path = apkPath;
|
||||||
if (!new File(path).exists()) {
|
if (!new File(path).exists()) {
|
||||||
path = getModuleApkPath(pkgInfo.applicationInfo);
|
path = getModuleApkPath(pkgInfo.applicationInfo);
|
||||||
if (path == null)
|
if (path == null) obsoleteModules.add(packageName);
|
||||||
obsoleteModules.add(packageName);
|
else obsoletePaths.put(packageName, path);
|
||||||
else
|
|
||||||
obsoletePaths.put(packageName, path);
|
|
||||||
}
|
}
|
||||||
var file = loadModule(path);
|
var file = loadModule(path);
|
||||||
if (file == null) {
|
if (file == null) {
|
||||||
|
|
@ -679,13 +677,14 @@ public class ConfigManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
public String getModuleApkPath(ApplicationInfo info) {
|
public String getModuleApkPath(ApplicationInfo info) {
|
||||||
String[] apks;
|
String[] apks;
|
||||||
if (info.splitSourceDirs != null) {
|
if (info.splitSourceDirs != null) {
|
||||||
apks = Arrays.copyOf(info.splitSourceDirs, info.splitSourceDirs.length + 1);
|
apks = Arrays.copyOf(info.splitSourceDirs, info.splitSourceDirs.length + 1);
|
||||||
apks[info.splitSourceDirs.length] = info.sourceDir;
|
apks[info.splitSourceDirs.length] = info.sourceDir;
|
||||||
} else apks = new String[]{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)) {
|
try (var zip = new ZipFile(apk)) {
|
||||||
return zip.getEntry("assets/xposed_init") != null;
|
return zip.getEntry("assets/xposed_init") != null;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue