Fix: 兼容特殊加固

問題出自
7b98d98389
只是嘗試性修復
This commit is contained in:
NkBe 2025-08-17 22:18:26 +08:00
parent 61cf11ee0e
commit 336ad9ecf8
No known key found for this signature in database
GPG Key ID: 75EF144ED8F4D7B8
1 changed files with 2 additions and 4 deletions

View File

@ -138,7 +138,6 @@ public class LSPApplication {
} }
} }
cacheApkPath.toFile().setWritable(false); cacheApkPath.toFile().setWritable(false);
var mPackages = (Map<?, ?>) XposedHelpers.getObjectField(activityThread, "mPackages"); var mPackages = (Map<?, ?>) XposedHelpers.getObjectField(activityThread, "mPackages");
mPackages.remove(appInfo.packageName); mPackages.remove(appInfo.packageName);
appLoadedApk = activityThread.getPackageInfoNoCheck(appInfo, compatInfo); appLoadedApk = activityThread.getPackageInfoNoCheck(appInfo, compatInfo);
@ -169,8 +168,8 @@ public class LSPApplication {
if (config.has("appComponentFactory")) { if (config.has("appComponentFactory")) {
try { try {
context.getClassLoader().loadClass(appInfo.appComponentFactory); context.getClassLoader().loadClass(appInfo.appComponentFactory);
} catch (ClassNotFoundException e) { // This will happen on some strange shells like 360 } catch (Throwable e) { // 捕捉更廣泛的類載入錯誤, 可能可以兼容部分加固如 360
Log.w(TAG, "Original AppComponentFactory not found: " + appInfo.appComponentFactory); Log.w(TAG, "Original AppComponentFactory not found: " + appInfo.appComponentFactory, e);
appInfo.appComponentFactory = null; appInfo.appComponentFactory = null;
} }
} }
@ -179,7 +178,6 @@ public class LSPApplication {
Log.e(TAG, "createLoadedApk", e); Log.e(TAG, "createLoadedApk", e);
return null; return null;
} }
}
public static void disableProfile(Context context) { public static void disableProfile(Context context) {
final ArrayList<String> codePaths = new ArrayList<>(); final ArrayList<String> codePaths = new ArrayList<>();