SandHook: remove useless logic
This commit is contained in:
parent
0a9bb7074a
commit
71774746cf
|
|
@ -30,12 +30,6 @@ public class Router {
|
||||||
|
|
||||||
private static volatile AtomicBoolean bootstrapHooked = new AtomicBoolean(false);
|
private static volatile AtomicBoolean bootstrapHooked = new AtomicBoolean(false);
|
||||||
|
|
||||||
static boolean useSandHook;
|
|
||||||
|
|
||||||
static {
|
|
||||||
useSandHook = EdXpConfigGlobal.getHookProvider() instanceof SandHookProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void prepare(boolean isSystem) {
|
public static void prepare(boolean isSystem) {
|
||||||
// this flag is needed when loadModules
|
// this flag is needed when loadModules
|
||||||
|
|
@ -86,46 +80,18 @@ public class Router {
|
||||||
Utils.logD("startBootstrapHook starts: isSystem = " + isSystem);
|
Utils.logD("startBootstrapHook starts: isSystem = " + isSystem);
|
||||||
ClassLoader classLoader = XposedBridge.BOOTCLASSLOADER;
|
ClassLoader classLoader = XposedBridge.BOOTCLASSLOADER;
|
||||||
if (isSystem) {
|
if (isSystem) {
|
||||||
if (useSandHook) {
|
|
||||||
XposedCompat.addHookers(classLoader, SysBootstrapHookInfo.hookItems);
|
XposedCompat.addHookers(classLoader, SysBootstrapHookInfo.hookItems);
|
||||||
} else {
|
} else {
|
||||||
HookMain.doHookDefault(
|
|
||||||
Router.class.getClassLoader(),
|
|
||||||
classLoader,
|
|
||||||
SysBootstrapHookInfo.class.getName());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (useSandHook) {
|
|
||||||
XposedCompat.addHookers(classLoader, AppBootstrapHookInfo.hookItems);
|
XposedCompat.addHookers(classLoader, AppBootstrapHookInfo.hookItems);
|
||||||
} else {
|
|
||||||
HookMain.doHookDefault(
|
|
||||||
Router.class.getClassLoader(),
|
|
||||||
classLoader,
|
|
||||||
AppBootstrapHookInfo.class.getName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void startSystemServerHook() {
|
public static void startSystemServerHook() {
|
||||||
if (useSandHook) {
|
|
||||||
XposedCompat.addHookers(SystemMainHooker.systemServerCL, SysInnerHookInfo.hookItems);
|
XposedCompat.addHookers(SystemMainHooker.systemServerCL, SysInnerHookInfo.hookItems);
|
||||||
} else {
|
|
||||||
HookMain.doHookDefault(
|
|
||||||
Router.class.getClassLoader(),
|
|
||||||
SystemMainHooker.systemServerCL,
|
|
||||||
SysInnerHookInfo.class.getName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void startWorkAroundHook() {
|
public static void startWorkAroundHook() {
|
||||||
if (useSandHook) {
|
|
||||||
XposedCompat.addHookers(XposedBridge.BOOTCLASSLOADER, WorkAroundHookInfo.hookItems);
|
XposedCompat.addHookers(XposedBridge.BOOTCLASSLOADER, WorkAroundHookInfo.hookItems);
|
||||||
} else {
|
|
||||||
HookMain.doHookDefault(
|
|
||||||
Router.class.getClassLoader(),
|
|
||||||
XposedBridge.BOOTCLASSLOADER,
|
|
||||||
WorkAroundHookInfo.class.getName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onEnterChildProcess() {
|
public static void onEnterChildProcess() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue