Fix openat hook
This commit is contained in:
parent
fa4f4cecff
commit
dbc9d3aa61
|
|
@ -45,6 +45,7 @@ import java.util.zip.ZipFile;
|
||||||
|
|
||||||
import de.robv.android.xposed.XC_MethodHook;
|
import de.robv.android.xposed.XC_MethodHook;
|
||||||
import de.robv.android.xposed.XposedHelpers;
|
import de.robv.android.xposed.XposedHelpers;
|
||||||
|
import de.robv.android.xposed.XposedInit;
|
||||||
import hidden.HiddenApiBridge;
|
import hidden.HiddenApiBridge;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -103,6 +104,8 @@ public class LSPApplication extends ApplicationServiceClient {
|
||||||
loadModules(context);
|
loadModules(context);
|
||||||
Main.forkPostCommon(false, context.getDataDir().toString(), ActivityThread.currentProcessName());
|
Main.forkPostCommon(false, context.getDataDir().toString(), ActivityThread.currentProcessName());
|
||||||
doHook(context);
|
doHook(context);
|
||||||
|
Log.i(TAG, "Start loading modules");
|
||||||
|
XposedInit.loadModules();
|
||||||
// WARN: Since it uses `XResource`, the following class should not be initialized
|
// WARN: Since it uses `XResource`, the following class should not be initialized
|
||||||
// before forkPostCommon is invoke. Otherwise, you will get failure of XResources
|
// before forkPostCommon is invoke. Otherwise, you will get failure of XResources
|
||||||
LSPLoader.initModules(context);
|
LSPLoader.initModules(context);
|
||||||
|
|
@ -173,7 +176,7 @@ public class LSPApplication extends ApplicationServiceClient {
|
||||||
String packageName = name.substring(0, name.length() - 4);
|
String packageName = name.substring(0, name.length() - 4);
|
||||||
String modulePath = context.getCacheDir() + "/lspatch/" + packageName + "/";
|
String modulePath = context.getCacheDir() + "/lspatch/" + packageName + "/";
|
||||||
String cacheApkPath;
|
String cacheApkPath;
|
||||||
try (ZipFile sourceFile = new ZipFile(context.getApplicationInfo().sourceDir)) {
|
try (ZipFile sourceFile = new ZipFile(context.getPackageResourcePath())) {
|
||||||
cacheApkPath = modulePath + sourceFile.getEntry("assets/modules/" + name).getCrc();
|
cacheApkPath = modulePath + sourceFile.getEntry("assets/modules/" + name).getCrc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -190,7 +193,7 @@ public class LSPApplication extends ApplicationServiceClient {
|
||||||
module.apkPath = cacheApkPath;
|
module.apkPath = cacheApkPath;
|
||||||
module.packageName = packageName;
|
module.packageName = packageName;
|
||||||
module.file = loadModule(cacheApkPath);
|
module.file = loadModule(cacheApkPath);
|
||||||
if (module.file != null) module.file.hostApk = context.getApplicationInfo().sourceDir;
|
if (module.file != null) module.file.hostApk = context.getPackageResourcePath();
|
||||||
modules.add(module);
|
modules.add(module);
|
||||||
}
|
}
|
||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
|
|
@ -280,11 +283,10 @@ public class LSPApplication extends ApplicationServiceClient {
|
||||||
}
|
}
|
||||||
if (bypassLv >= Constants.SIGBYPASS_LV_PM_OPENAT) {
|
if (bypassLv >= Constants.SIGBYPASS_LV_PM_OPENAT) {
|
||||||
String cacheApkPath;
|
String cacheApkPath;
|
||||||
var aInfo = context.getApplicationInfo();
|
try (ZipFile sourceFile = new ZipFile(context.getPackageResourcePath())) {
|
||||||
try (ZipFile sourceFile = new ZipFile(aInfo.sourceDir)) {
|
cacheApkPath = context.getCacheDir() + "/lspatch/origin/" + sourceFile.getEntry(ORIGINAL_APK_ASSET_PATH).getCrc();
|
||||||
cacheApkPath = aInfo.dataDir + "/cache/lspatch/origin/" + sourceFile.getEntry(ORIGINAL_APK_ASSET_PATH).getCrc();
|
|
||||||
}
|
}
|
||||||
SigBypass.enableOpenatHook(context.getApplicationInfo().sourceDir, cacheApkPath);
|
SigBypass.enableOpenatHook(context.getPackageResourcePath(), cacheApkPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
2
core
2
core
|
|
@ -1 +1 @@
|
||||||
Subproject commit d76db3cb82d52c648aed4c8e798eb0385936589c
|
Subproject commit 89eedddbd94af1240c14e6172e98c19bd4c7cafa
|
||||||
Loading…
Reference in New Issue