diff --git a/edxp-core/jni/main/include/config.h b/edxp-core/jni/main/include/config.h index eda55916..4efe8778 100644 --- a/edxp-core/jni/main/include/config.h +++ b/edxp-core/jni/main/include/config.h @@ -12,4 +12,8 @@ #define ENTRY_CLASS_NAME "com.elderdrivers.riru.edxp.Main" +#define CLASS_SAND_HOOK "com.swift.sandhook.SandHook" + +#define CLASS_NEVER_CALL "com.swift.sandhook.ClassNeverCall" + #endif //CONFIG_H \ No newline at end of file diff --git a/edxp-core/jni/main/java_hook/java_hook.cpp b/edxp-core/jni/main/java_hook/java_hook.cpp index 889a2a17..2e9194ec 100644 --- a/edxp-core/jni/main/java_hook/java_hook.cpp +++ b/edxp-core/jni/main/java_hook/java_hook.cpp @@ -168,6 +168,29 @@ void loadDexAndInit(JNIEnv *env, const char *dexPath) { } else { LOGE("HookEntry class is null. %d", getpid()); } + + //load lib sandhook + void* lib_sandhook; + if (sizeof(void*) == 8) { + lib_sandhook = dlopen("/system/lib64/libsandhook.edxp.so", RTLD_NOW); + } else { + lib_sandhook = dlopen("/system/lib/libsandhook.edxp.so", RTLD_NOW); + } + if (!lib_sandhook) { + LOGW("libsandhook open failed. %s", dlerror()); + return; + } + bool* (*jni_load)(JNIEnv*, jclass, jclass) = reinterpret_cast(dlsym(lib_sandhook, "JNI_Load_Ex")); + + jclass sandhook_class = findClassFromLoader(env, myClassLoader, CLASS_SAND_HOOK); + jclass nevercall_class = findClassFromLoader(env, myClassLoader, CLASS_NEVER_CALL); + if (!sandhook_class || !nevercall_class) { // fail-fast + return; + } + if (!jni_load(env, sandhook_class, nevercall_class)) { + LOGE("SandHook: HookEntry class error. %d", getpid()); + } } jstring getThrowableMessage(JNIEnv *env, jobject throwable) { diff --git a/edxp-sandhook/build.gradle b/edxp-sandhook/build.gradle index 324b7621..c409c4a6 100644 --- a/edxp-sandhook/build.gradle +++ b/edxp-sandhook/build.gradle @@ -24,7 +24,7 @@ dependencies { compileOnly files("libs/framework-stub.jar") implementation project(':edxp-common') implementation project(':xposed-bridge') - implementation 'com.swift.sandhook:hooklib:3.0.1' + implementation 'com.swift.sandhook:hooklib:3.2.2' compileOnly project(':dexmaker') } diff --git a/edxp-sandhook/genhookstubs.py b/edxp-sandhook/genhookstubs.py index feddcd89..f3cd9b7a 100644 --- a/edxp-sandhook/genhookstubs.py +++ b/edxp-sandhook/genhookstubs.py @@ -60,8 +60,9 @@ TEMP_STUB_INFO = """ """ -STUB_SIZES = [10,20,30,30,30,30,30,20,10,10,5,5,3] -HAS_BACKUP = False; +STUB_SIZES_32 = [10,20,30,30,30,30,30,20,10,10,5,5,3] +STUB_SIZES_64 = [10,20,30,30,30,30,50,50] +HAS_BACKUP = False def getMethodId(args, index): @@ -126,20 +127,29 @@ def genCallOriginClass(is64Bit, args, index): method = TEMP_STUB_CALL_ORIGIN_CLASS % (getCallOriginClassName(args, index), getMethodBackupName(index), genArgsListForCallOriginMethod(is64Bit, args)) return method -def genStubInfo(): +def genStubInfo32(): hasStub = "true" if HAS_BACKUP else "false" stubSizes = "" - for args in range(len(STUB_SIZES)): + for args in range(len(STUB_SIZES_32)): if (args != 0): stubSizes += ", " - stubSizes += str(STUB_SIZES[args]) + stubSizes += str(STUB_SIZES_32[args]) + return TEMP_STUB_INFO % (hasStub, stubSizes) + +def genStubInfo64(): + hasStub = "true" if HAS_BACKUP else "false" + stubSizes = "" + for args in range(len(STUB_SIZES_64)): + if (args != 0): + stubSizes += ", " + stubSizes += str(STUB_SIZES_64[args]) return TEMP_STUB_INFO % (hasStub, stubSizes) def gen32Stub(packageDir): - class_content = genStubInfo() + class_content = genStubInfo32() class_name = STUB_FILE_NAME + "32" - for args in range(len(STUB_SIZES)): - for index in range(STUB_SIZES[args]): + for args in range(len(STUB_SIZES_32)): + for index in range(STUB_SIZES_32[args]): class_content += """\n\n\t//stub of arg size %d, index %d""" % (args, index) class_content += genHookMethod(False, args, index) if HAS_BACKUP: @@ -155,10 +165,10 @@ def gen32Stub(packageDir): def gen64Stub(packageDir): - class_content = genStubInfo() + class_content = genStubInfo64() class_name = STUB_FILE_NAME + "64" - for args in range(len(STUB_SIZES)): - for index in range(STUB_SIZES[args]): + for args in range(len(STUB_SIZES_64)): + for index in range(STUB_SIZES_64[args]): class_content += """\n\n\t//stub of arg size %d, index %d""" % (args, index) class_content += genHookMethod(True, args, index) if HAS_BACKUP: diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/Main.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/Main.java index b4f0ab86..ba3214c2 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/Main.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/Main.java @@ -12,6 +12,7 @@ import com.elderdrivers.riru.edxp.sandhook.core.HookMethodResolver; import com.elderdrivers.riru.edxp.sandhook.entry.Router; import com.elderdrivers.riru.edxp.sandhook.proxy.BlackWhiteListProxy; import com.elderdrivers.riru.edxp.sandhook.proxy.NormalProxy; +import com.swift.sandhook.xposedcompat.XposedCompat; import com.swift.sandhook.xposedcompat.methodgen.SandHookXposedBridge; import java.lang.reflect.Method; @@ -31,7 +32,12 @@ public class Main implements KeepAll { HookMethodResolver.init(); Router.injectConfig(); InstallerChooser.setInstallerPackageName(getInstallerPkgName()); - SandHookXposedBridge.setLibPath(); + SandHookXposedBridge.init(); + } + + public static void setAppDataDir(String appDataDir) { + Main.appDataDir = appDataDir; + XposedCompat.appDataDir = appDataDir; } /////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/config/SandHookProvider.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/config/SandHookProvider.java index 967b2410..f77dcfa6 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/config/SandHookProvider.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/config/SandHookProvider.java @@ -1,11 +1,15 @@ package com.elderdrivers.riru.edxp.sandhook.config; +import android.util.Log; + import com.elderdrivers.riru.edxp.hook.HookProvider; import com.elderdrivers.riru.edxp.sandhook.dexmaker.DexMakerUtils; +import com.elderdrivers.riru.edxp.sandhook.dexmaker.DynamicBridge; import com.elderdrivers.riru.edxp.sandhook.util.PrebuiltMethodsDeopter; import com.swift.sandhook.xposedcompat.XposedCompat; import com.swift.sandhook.xposedcompat.methodgen.SandHookXposedBridge; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Member; import de.robv.android.xposed.XposedBridge; @@ -13,12 +17,27 @@ import de.robv.android.xposed.XposedBridge; public class SandHookProvider implements HookProvider { @Override public void hookMethod(Member method, XposedBridge.AdditionalHookInfo additionalInfo) { + if (SandHookXposedBridge.hooked(method) || DynamicBridge.hooked(method)) { + return; + } + if (method.getDeclaringClass() == Log.class) { + Log.e(XposedBridge.TAG, "some one hook Log!"); + return; + } XposedCompat.hookMethod(method, additionalInfo); } @Override public Object invokeOriginalMethod(Member method, long methodId, Object thisObject, Object[] args) throws Throwable { - return SandHookXposedBridge.invokeOriginalMethod(method, thisObject, args); + if (SandHookXposedBridge.hooked(method)) { + try { + return SandHookXposedBridge.invokeOriginalMethod(method, thisObject, args); + } catch (Throwable throwable) { + throw new InvocationTargetException(throwable); + } + } else { + return DynamicBridge.invokeOriginalMethod(method, thisObject, args); + } } @Override diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/dexmaker/DynamicBridge.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/dexmaker/DynamicBridge.java index 66fca6c7..2437185f 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/dexmaker/DynamicBridge.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/dexmaker/DynamicBridge.java @@ -9,6 +9,7 @@ import java.lang.reflect.Member; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.HashMap; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicBoolean; import de.robv.android.xposed.XposedBridge; @@ -20,7 +21,7 @@ import static com.elderdrivers.riru.edxp.sandhook.dexmaker.DexMakerUtils.shouldU public final class DynamicBridge { - private static final HashMap hookedInfo = new HashMap<>(); + private static final ConcurrentHashMap hookedInfo = new ConcurrentHashMap<>(); private static final HookerDexMaker dexMaker = new HookerDexMaker(); private static final AtomicBoolean dexPathInited = new AtomicBoolean(false); private static File dexDir; @@ -33,6 +34,10 @@ public final class DynamicBridge { dexPathInited.set(false); } + public static boolean hooked(Member member) { + return hookedInfo.containsKey(member); + } + public static synchronized void hookMethod(Member hookMethod, XposedBridge.AdditionalHookInfo additionalHookInfo) { DexLog.d("hooking " + hookMethod); if (!checkMember(hookMethod)) { diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/Router.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/Router.java index 281c1bd8..d7c126ce 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/Router.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/Router.java @@ -14,6 +14,8 @@ import com.elderdrivers.riru.edxp.sandhook.entry.bootstrap.SysBootstrapHookInfo; import com.elderdrivers.riru.edxp.sandhook.entry.bootstrap.SysInnerHookInfo; import com.elderdrivers.riru.edxp.sandhook.entry.bootstrap.WorkAroundHookInfo; import com.elderdrivers.riru.edxp.sandhook.entry.hooker.SystemMainHooker; +import com.swift.sandhook.SandHookConfig; +import com.swift.sandhook.xposedcompat.XposedCompat; import com.swift.sandhook.xposedcompat.methodgen.SandHookXposedBridge; import java.util.concurrent.atomic.AtomicBoolean; @@ -21,6 +23,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import de.robv.android.xposed.XposedBridge; import de.robv.android.xposed.XposedInit; +import static de.robv.android.xposed.XposedInit.startsSystemServer; + public class Router { public volatile static boolean forkCompleted = false; @@ -30,7 +34,7 @@ public class Router { public static void prepare(boolean isSystem) { // this flag is needed when loadModules - XposedInit.startsSystemServer = isSystem; + startsSystemServer = isSystem; // InstallerChooser.setup(); } @@ -81,19 +85,22 @@ public class Router { Router.class.getClassLoader(), classLoader, SysBootstrapHookInfo.class.getName()); + XposedCompat.addHookers(classLoader, SysBootstrapHookInfo.hookItems); } else { HookMain.doHookDefault( Router.class.getClassLoader(), classLoader, AppBootstrapHookInfo.class.getName()); + XposedCompat.addHookers(classLoader, AppBootstrapHookInfo.hookItems); } } public static void startSystemServerHook() { - HookMain.doHookDefault( - Router.class.getClassLoader(), - SystemMainHooker.systemServerCL, - SysInnerHookInfo.class.getName()); +// HookMain.doHookDefault( +// Router.class.getClassLoader(), +// SystemMainHooker.systemServerCL, +// SysInnerHookInfo.class.getName()); + XposedCompat.addHookers(SystemMainHooker.systemServerCL, SysInnerHookInfo.hookItems); } public static void startWorkAroundHook() { @@ -106,7 +113,8 @@ public class Router { public static void onEnterChildProcess() { forkCompleted = true; DynamicBridge.onForkPost(); - SandHookXposedBridge.onForkPost(); + //enable compile in child process + //SandHook.enableCompiler(!XposedInit.startsSystemServer); } public static void logD(String prefix) { @@ -122,5 +130,6 @@ public class Router { public static void injectConfig() { EdXpConfigGlobal.sConfig = new SandHookEdxpConfig(); EdXpConfigGlobal.sHookProvider = new SandHookProvider(); + SandHookConfig.compiler = !startsSystemServer; } } diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/AppBootstrapHookInfo.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/AppBootstrapHookInfo.java index 7e630062..09a15f13 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/AppBootstrapHookInfo.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/AppBootstrapHookInfo.java @@ -7,8 +7,11 @@ import com.elderdrivers.riru.edxp.sandhook.entry.hooker.OnePlusWorkAroundHooker; public class AppBootstrapHookInfo implements KeepMembers { public static String[] hookItemNames = { - HandleBindAppHooker.class.getName(), - LoadedApkConstructorHooker.class.getName(), OnePlusWorkAroundHooker.class.getName() }; + + public static Class[] hookItems = { + HandleBindAppHooker.class, + LoadedApkConstructorHooker.class + }; } diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/SysBootstrapHookInfo.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/SysBootstrapHookInfo.java index 8fed0f42..7befb2ea 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/SysBootstrapHookInfo.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/SysBootstrapHookInfo.java @@ -8,9 +8,12 @@ import com.elderdrivers.riru.edxp.sandhook.entry.hooker.SystemMainHooker; public class SysBootstrapHookInfo implements KeepMembers { public static String[] hookItemNames = { - HandleBindAppHooker.class.getName(), - SystemMainHooker.class.getName(), - LoadedApkConstructorHooker.class.getName(), OnePlusWorkAroundHooker.class.getName() }; + + public static Class[] hookItems = { + HandleBindAppHooker.class, + SystemMainHooker.class, + LoadedApkConstructorHooker.class + }; } diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/SysInnerHookInfo.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/SysInnerHookInfo.java index 797ad9aa..a89542ab 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/SysInnerHookInfo.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/SysInnerHookInfo.java @@ -7,4 +7,8 @@ public class SysInnerHookInfo implements KeepMembers { public static String[] hookItemNames = { StartBootstrapServicesHooker.class.getName() }; + + public static Class[] hookItems = { + StartBootstrapServicesHooker.class + }; } diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/WorkAroundHookInfo.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/WorkAroundHookInfo.java index 8713185c..4602349e 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/WorkAroundHookInfo.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/bootstrap/WorkAroundHookInfo.java @@ -7,4 +7,7 @@ public class WorkAroundHookInfo implements KeepMembers { public static String[] hookItemNames = { OnePlusWorkAroundHooker.class.getName() }; + + public static Class[] hookItems = { + }; } diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/HandleBindAppHooker.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/HandleBindAppHooker.java index db2fe706..ce987cc7 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/HandleBindAppHooker.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/HandleBindAppHooker.java @@ -10,6 +10,16 @@ import com.elderdrivers.riru.common.KeepMembers; import com.elderdrivers.riru.edxp.util.Utils; import com.elderdrivers.riru.edxp.Main; import com.elderdrivers.riru.edxp.sandhook.entry.Router; +import com.swift.sandhook.SandHook; +import com.swift.sandhook.annotation.HookClass; +import com.swift.sandhook.annotation.HookMethod; +import com.swift.sandhook.annotation.HookMethodBackup; +import com.swift.sandhook.annotation.HookMode; +import com.swift.sandhook.annotation.Param; +import com.swift.sandhook.annotation.SkipParamCheck; +import com.swift.sandhook.annotation.ThisObject; + +import java.lang.reflect.Method; import de.robv.android.xposed.XposedBridge; import de.robv.android.xposed.XposedHelpers; @@ -21,15 +31,21 @@ import static com.elderdrivers.riru.edxp.util.ClassLoaderUtils.replaceParentClas import static com.elderdrivers.riru.edxp.sandhook.entry.hooker.XposedBlackListHooker.BLACK_LIST_PACKAGE_NAME; // normal process initialization (for new Activity, Service, BroadcastReceiver etc.) +@HookClass(ActivityThread.class) public class HandleBindAppHooker implements KeepMembers { public static String className = "android.app.ActivityThread"; public static String methodName = "handleBindApplication"; public static String methodSig = "(Landroid/app/ActivityThread$AppBindData;)V"; - public static void hook(Object thiz, Object bindData) { + @HookMethodBackup("handleBindApplication") + @SkipParamCheck + static Method backup; + + @HookMethod("handleBindApplication") + public static void hook(@ThisObject ActivityThread thiz, @Param("android.app.ActivityThread$AppBindData") Object bindData) throws Throwable { if (XposedBlackListHooker.shouldDisableHooks("")) { - backup(thiz, bindData); + SandHook.callOriginByBackup(backup, thiz, bindData); return; } try { @@ -80,7 +96,7 @@ public class HandleBindAppHooker implements KeepMembers { } catch (Throwable t) { Router.logE("error when hooking bindApp", t); } finally { - backup(thiz, bindData); + SandHook.callOriginByBackup(backup, thiz, bindData); } } diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/LoadedApkConstructorHooker.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/LoadedApkConstructorHooker.java index d31aa728..8121d63d 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/LoadedApkConstructorHooker.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/LoadedApkConstructorHooker.java @@ -9,6 +9,14 @@ import android.util.Log; import com.elderdrivers.riru.common.KeepMembers; import com.elderdrivers.riru.edxp.sandhook.entry.Router; +import com.swift.sandhook.SandHook; +import com.swift.sandhook.annotation.HookClass; +import com.swift.sandhook.annotation.HookMethod; +import com.swift.sandhook.annotation.HookMethodBackup; +import com.swift.sandhook.annotation.SkipParamCheck; +import com.swift.sandhook.annotation.ThisObject; + +import java.lang.reflect.Method; import de.robv.android.xposed.XposedBridge; import de.robv.android.xposed.XposedHelpers; @@ -19,6 +27,7 @@ import static com.elderdrivers.riru.edxp.util.ClassLoaderUtils.replaceParentClas // when a package is loaded for an existing process, trigger the callbacks as well // ed: remove resources related hooking +@HookClass(LoadedApk.class) public class LoadedApkConstructorHooker implements KeepMembers { public static String className = "android.app.LoadedApk"; public static String methodName = ""; @@ -27,20 +36,24 @@ public class LoadedApkConstructorHooker implements KeepMembers { "Landroid/content/res/CompatibilityInfo;" + "Ljava/lang/ClassLoader;ZZZ)V"; - public static void hook(Object thiz, ActivityThread activityThread, + @HookMethodBackup + @SkipParamCheck + static Method backup; + + @HookMethod + public static void hook(@ThisObject Object thiz, ActivityThread activityThread, ApplicationInfo aInfo, CompatibilityInfo compatInfo, ClassLoader baseLoader, boolean securityViolation, - boolean includeCode, boolean registerPackage) { + boolean includeCode, boolean registerPackage) throws Throwable { if (XposedBlackListHooker.shouldDisableHooks("")) { - backup(thiz, activityThread, aInfo, compatInfo, baseLoader, securityViolation, - includeCode, registerPackage); + SandHook.callOriginByBackup(backup, thiz, activityThread, aInfo, compatInfo, baseLoader, securityViolation, includeCode, registerPackage); + return; } Router.logD("LoadedApk# starts"); - backup(thiz, activityThread, aInfo, compatInfo, baseLoader, securityViolation, - includeCode, registerPackage); + SandHook.callOriginByBackup(backup, thiz, activityThread, aInfo, compatInfo, baseLoader, securityViolation, includeCode, registerPackage); try { LoadedApk loadedApk = (LoadedApk) thiz; diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/OnePlusWorkAroundHooker.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/OnePlusWorkAroundHooker.java index e83b1f45..d0995649 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/OnePlusWorkAroundHooker.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/OnePlusWorkAroundHooker.java @@ -3,7 +3,14 @@ package com.elderdrivers.riru.edxp.sandhook.entry.hooker; import com.elderdrivers.riru.common.KeepMembers; import com.elderdrivers.riru.edxp.Main; import com.elderdrivers.riru.edxp.sandhook.entry.Router; +import com.swift.sandhook.annotation.HookClass; +import com.swift.sandhook.annotation.HookMethod; +import com.swift.sandhook.annotation.HookMethodBackup; +import com.swift.sandhook.annotation.SkipParamCheck; +import java.lang.reflect.Method; + +import dalvik.system.BaseDexClassLoader; import de.robv.android.xposed.XposedBridge; /** @@ -21,12 +28,18 @@ import de.robv.android.xposed.XposedBridge; * open of /dev/binder and we haven't found side effects yet. * Other roms might share the same problems but not reported too. */ +@HookClass(BaseDexClassLoader.class) public class OnePlusWorkAroundHooker implements KeepMembers { public static String className = "dalvik.system.BaseDexClassLoader"; public static String methodName = "inCompatConfigList"; public static String methodSig = "(ILjava/lang/String;)Z"; + @HookMethodBackup("inCompatConfigList") + @SkipParamCheck + static Method backup; + + @HookMethod("inCompatConfigList") public static boolean hook(int type, String packageName) { if (XposedBridge.disableHooks || Router.forkCompleted) { return backup(type, packageName); diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/StartBootstrapServicesHooker.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/StartBootstrapServicesHooker.java index 0b2f8428..39a69266 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/StartBootstrapServicesHooker.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/StartBootstrapServicesHooker.java @@ -4,6 +4,15 @@ import android.os.Build; import com.elderdrivers.riru.common.KeepMembers; import com.elderdrivers.riru.edxp.sandhook.entry.Router; +import com.swift.sandhook.SandHook; +import com.swift.sandhook.annotation.HookMethod; +import com.swift.sandhook.annotation.HookMethodBackup; +import com.swift.sandhook.annotation.HookMode; +import com.swift.sandhook.annotation.HookReflectClass; +import com.swift.sandhook.annotation.SkipParamCheck; +import com.swift.sandhook.annotation.ThisObject; + +import java.lang.reflect.Method; import de.robv.android.xposed.XC_MethodReplacement; import de.robv.android.xposed.XposedBridge; @@ -15,15 +24,21 @@ import static com.elderdrivers.riru.edxp.util.ClassLoaderUtils.replaceParentClas import static com.elderdrivers.riru.edxp.util.Utils.logD; import static de.robv.android.xposed.XposedHelpers.findAndHookMethod; +@HookReflectClass("com.android.server.SystemServer") public class StartBootstrapServicesHooker implements KeepMembers { public static String className = "com.android.server.SystemServer"; public static String methodName = "startBootstrapServices"; public static String methodSig = "()V"; - public static void hook(Object systemServer) { + @HookMethodBackup("startBootstrapServices") + @SkipParamCheck + static Method backup; + + @HookMethod("startBootstrapServices") + public static void hook(@ThisObject Object systemServer) throws Throwable { if (XposedBridge.disableHooks) { - backup(systemServer); + SandHook.callOriginByBackup(backup, systemServer); return; } @@ -56,7 +71,7 @@ public class StartBootstrapServicesHooker implements KeepMembers { } catch (Throwable t) { Router.logE("error when hooking startBootstrapServices", t); } finally { - backup(systemServer); + SandHook.callOriginByBackup(backup, systemServer); } } diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/SystemMainHooker.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/SystemMainHooker.java index f33db3e7..5b9ae61b 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/SystemMainHooker.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/entry/hooker/SystemMainHooker.java @@ -5,12 +5,20 @@ import android.app.ActivityThread; import com.elderdrivers.riru.common.KeepMembers; import com.elderdrivers.riru.edxp.sandhook.entry.Router; import com.elderdrivers.riru.edxp.sandhook.util.PrebuiltMethodsDeopter; +import com.swift.sandhook.SandHook; +import com.swift.sandhook.annotation.HookClass; +import com.swift.sandhook.annotation.HookMethod; +import com.swift.sandhook.annotation.HookMethodBackup; +import com.swift.sandhook.annotation.HookMode; + +import java.lang.reflect.Method; import de.robv.android.xposed.XposedBridge; // system_server initialization // ed: only support sdk >= 21 for now +@HookClass(ActivityThread.class) public class SystemMainHooker implements KeepMembers { public static String className = "android.app.ActivityThread"; @@ -19,12 +27,16 @@ public class SystemMainHooker implements KeepMembers { public static ClassLoader systemServerCL; - public static ActivityThread hook() { + @HookMethodBackup("systemMain") + static Method backup; + + @HookMethod("systemMain") + public static ActivityThread hook() throws Throwable { if (XposedBridge.disableHooks) { - return backup(); + return (ActivityThread) SandHook.callOriginByBackup(backup, null); } Router.logD("ActivityThread#systemMain() starts"); - ActivityThread activityThread = backup(); + ActivityThread activityThread = (ActivityThread) SandHook.callOriginByBackup(backup, null); try { // get system_server classLoader systemServerCL = Thread.currentThread().getContextClassLoader(); diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/proxy/BlackWhiteListProxy.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/proxy/BlackWhiteListProxy.java index 5ddfdc2a..fec53890 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/proxy/BlackWhiteListProxy.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/proxy/BlackWhiteListProxy.java @@ -88,7 +88,7 @@ public class BlackWhiteListProxy { } private static void onForkPostCommon(boolean isSystemServer, String appDataDir, String niceName) { - Main.appDataDir = appDataDir; + Main.setAppDataDir(appDataDir); Main.niceName = niceName; final boolean isDynamicModulesMode = Main.isDynamicModulesEnabled(); ConfigManager.setDynamicModulesMode(isDynamicModulesMode); diff --git a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/proxy/NormalProxy.java b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/proxy/NormalProxy.java index b09ff554..10d97ec2 100644 --- a/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/proxy/NormalProxy.java +++ b/edxp-sandhook/src/main/java/com/elderdrivers/riru/edxp/sandhook/proxy/NormalProxy.java @@ -29,7 +29,7 @@ public class NormalProxy { public static void forkAndSpecializePost(int pid, String appDataDir, String niceName) { // TODO consider processes without forkAndSpecializePost called - Main.appDataDir = appDataDir; + Main.setAppDataDir(appDataDir); Main.niceName = niceName; Router.prepare(false); Main.reopenFilesAfterForkNative(); @@ -58,7 +58,7 @@ public class NormalProxy { public static void forkSystemServerPost(int pid) { // in system_server process - Main.appDataDir = getDataPathPrefix() + "android"; + Main.setAppDataDir(getDataPathPrefix() + "android"); Main.niceName = "system_server"; Router.prepare(true); Main.reopenFilesAfterForkNative(); diff --git a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/XposedCompat.java b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/XposedCompat.java index 7b494b50..d3f8e893 100644 --- a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/XposedCompat.java +++ b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/XposedCompat.java @@ -1,23 +1,65 @@ package com.swift.sandhook.xposedcompat; +import android.annotation.SuppressLint; +import android.os.Process; +import android.text.TextUtils; + +import com.swift.sandhook.SandHook; import com.swift.sandhook.xposedcompat.classloaders.ComposeClassLoader; import com.swift.sandhook.xposedcompat.methodgen.SandHookXposedBridge; +import com.swift.sandhook.xposedcompat.utils.ApplicationUtils; import com.swift.sandhook.xposedcompat.utils.FileUtils; +import com.swift.sandhook.xposedcompat.utils.ProcessUtils; import java.io.File; import java.lang.reflect.Member; import de.robv.android.xposed.XposedBridge; +import static com.elderdrivers.riru.edxp.util.ProcessUtils.PER_USER_RANGE; +import static com.swift.sandhook.xposedcompat.utils.FileUtils.IS_USING_PROTECTED_STORAGE; + public class XposedCompat { + public static volatile String appDataDir; + + // TODO initialize these variables + public static volatile File cacheDir; + public static volatile ClassLoader classLoader; + //try to use internal stub hooker & backup method to speed up hook public static volatile boolean useInternalStub = true; - public static volatile boolean useNewDexMaker = true; + public static volatile boolean useNewCallBackup = true; public static volatile boolean retryWhenCallOriginError = false; private static ClassLoader sandHookXposedClassLoader; + public static void addHookers(ClassLoader classLoader, Class[] hookers) { + if (hookers == null) + return; + for (Class hooker:hookers) { + try { + SandHook.addHookClass(classLoader, hooker); + } catch (Throwable throwable) {} + } + } + + public static File getCacheDir() { + if (cacheDir == null) { + String fixedAppDataDir = getDataPathPrefix() + getPackageName(appDataDir) + "/"; + cacheDir = new File(fixedAppDataDir, "/cache/sandhook/" + + ProcessUtils.getProcessName().replace(":", "_") + "/"); + } + return cacheDir; + } + + public static ClassLoader getClassLoader() { + if (classLoader == null) { + classLoader = getSandHookXposedClassLoader(ApplicationUtils.currentApplication().getClassLoader(), XposedCompat.class.getClassLoader()); + } + return classLoader; + } + public static synchronized void hookMethod(Member hookMethod, XposedBridge.AdditionalHookInfo additionalHookInfo) { SandHookXposedBridge.hookMethod(hookMethod, additionalHookInfo); } @@ -31,18 +73,37 @@ public class XposedCompat { } } -// public static boolean clearCache() { -// try { -// FileUtils.delete(cacheDir); -// cacheDir.mkdirs(); -// return true; -// } catch (Throwable throwable) { -// return false; -// } -// } -// -// public static void clearOatCache() { -// SandHookXposedBridge.clearOatFile(); -// } + public static boolean clearCache() { + try { + FileUtils.delete(getCacheDir()); + getCacheDir().mkdirs(); + return true; + } catch (Throwable throwable) { + return false; + } + } + + public static void clearOatCache() { + SandHookXposedBridge.clearOatFile(); + } + + public static String getPackageName(String dataDir) { + if (TextUtils.isEmpty(dataDir)) { + return ""; + } + int lastIndex = dataDir.lastIndexOf("/"); + if (lastIndex < 0) { + return dataDir; + } + return dataDir.substring(lastIndex + 1); + } + + // FIXME: Although multi-users is considered here, but compat mode doesn't support other users' apps on Oreo and later yet. + @SuppressLint("SdCardPath") + public static String getDataPathPrefix() { + int userId = Process.myUid() / PER_USER_RANGE; + String format = IS_USING_PROTECTED_STORAGE ? "/data/user_de/%d/" : "/data/user/%d/"; + return String.format(format, userId); + } } diff --git a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/hookstub/HookStubManager.java b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/hookstub/HookStubManager.java index 1b27ed4a..75773d47 100644 --- a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/hookstub/HookStubManager.java +++ b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/hookstub/HookStubManager.java @@ -6,6 +6,7 @@ import com.swift.sandhook.SandHook; import com.swift.sandhook.SandHookMethodResolver; import com.swift.sandhook.utils.ParamWrapper; import com.swift.sandhook.wrapper.BackupMethodStubs; +import com.swift.sandhook.xposedcompat.XposedCompat; import com.swift.sandhook.xposedcompat.utils.DexLog; import java.lang.reflect.Constructor; @@ -23,12 +24,15 @@ import static de.robv.android.xposed.XposedBridge.sHookedMethodCallbacks; public class HookStubManager { + public static volatile boolean is64Bit; + //64bits arg0 - arg7 is in reg x1 - x7 and > 7 is in stack, but can not match + public final static int MAX_64_ARGS = 7; public static int MAX_STUB_ARGS = 0; public static int[] stubSizes; - public static boolean hasStubBackup = false; + public static boolean hasStubBackup; public static AtomicInteger[] curUseStubIndexes; @@ -41,10 +45,11 @@ public class HookStubManager { = sHookedMethodCallbacks; static { - Class stubClass = SandHook.is64Bit() ? MethodHookerStubs64.class : MethodHookerStubs32.class; + is64Bit = SandHook.is64Bit(); + Class stubClass = is64Bit ? MethodHookerStubs64.class : MethodHookerStubs32.class; stubSizes = (int[]) XposedHelpers.getStaticObjectField(stubClass, "stubSizes"); Boolean hasBackup = (Boolean) XposedHelpers.getStaticObjectField(stubClass, "hasStubBackup"); - hasStubBackup = hasBackup == null ? false : hasBackup; + hasStubBackup = hasBackup != null && (hasBackup && !XposedCompat.useNewCallBackup); if (stubSizes != null && stubSizes.length > 0) { MAX_STUB_ARGS = stubSizes.length - 1; curUseStubIndexes = new AtomicInteger[MAX_STUB_ARGS + 1]; @@ -89,6 +94,8 @@ public class HookStubManager { needStubArgCount += parType.length; if (needStubArgCount > MAX_STUB_ARGS) return null; + if (is64Bit && needStubArgCount > MAX_64_ARGS) + return null; for (Class par:parType) { if (!ParamWrapper.support(par)) return null; @@ -98,7 +105,7 @@ public class HookStubManager { } synchronized (HookStubManager.class) { - StubMethodsInfo stubMethodInfo = getStubMethodPair(SandHook.is64Bit(), needStubArgCount); + StubMethodsInfo stubMethodInfo = getStubMethodPair(is64Bit, needStubArgCount); if (stubMethodInfo == null) return null; HookMethodEntity entity = new HookMethodEntity(origin, stubMethodInfo.hook, stubMethodInfo.backup); @@ -180,7 +187,7 @@ public class HookStubManager { } public static Method getCallOriginMethod(int args, int index) { - Class stubClass = SandHook.is64Bit() ? MethodHookerStubs64.class : MethodHookerStubs32.class; + Class stubClass = is64Bit ? MethodHookerStubs64.class : MethodHookerStubs32.class; String className = stubClass.getName(); className += "$"; className += getCallOriginClassName(args, index); @@ -294,7 +301,6 @@ public class HookStubManager { param.setResult(SandHook.callOriginMethod(originMethod, thiz, param.args)); } } catch (Throwable e) { - XposedBridge.log(e); param.setThrowable(e); } } @@ -365,7 +371,6 @@ public class HookStubManager { try { param.setResult(SandHook.callOriginMethod(origin, thiz, param.args)); } catch (Throwable e) { - XposedBridge.log(e); param.setThrowable(e); } } diff --git a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/hookstub/MethodHookerStubs64.java b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/hookstub/MethodHookerStubs64.java index 17887583..4cdaff80 100644 --- a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/hookstub/MethodHookerStubs64.java +++ b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/hookstub/MethodHookerStubs64.java @@ -4,1410 +4,1512 @@ import static com.swift.sandhook.xposedcompat.hookstub.HookStubManager.getMethod import static com.swift.sandhook.xposedcompat.hookstub.HookStubManager.hookBridge; /** -* this file is auto gen by genhookstubs.py -* it is for sandhook internal hooker & backup methods -**/ + * this file is auto gen by genhookstubs.py + * it is for sandhook internal hooker & backup methods + **/ public class MethodHookerStubs64 { public static boolean hasStubBackup = false; - public static int[] stubSizes = {10, 20, 30, 30, 30, 30, 30, 20, 10, 10, 5, 5, 3}; + public static int[] stubSizes = {10, 20, 30, 30, 30, 30, 50, 50}; - //stub of arg size 0, index 0 + //stub of arg size 0, index 0 public static long stub_hook_0() throws Throwable { return hookBridge(getMethodId(0, 0), null ); } - //stub of arg size 0, index 1 + //stub of arg size 0, index 1 public static long stub_hook_1() throws Throwable { return hookBridge(getMethodId(0, 1), null ); } - //stub of arg size 0, index 2 + //stub of arg size 0, index 2 public static long stub_hook_2() throws Throwable { return hookBridge(getMethodId(0, 2), null ); } - //stub of arg size 0, index 3 + //stub of arg size 0, index 3 public static long stub_hook_3() throws Throwable { return hookBridge(getMethodId(0, 3), null ); } - //stub of arg size 0, index 4 + //stub of arg size 0, index 4 public static long stub_hook_4() throws Throwable { return hookBridge(getMethodId(0, 4), null ); } - //stub of arg size 0, index 5 + //stub of arg size 0, index 5 public static long stub_hook_5() throws Throwable { return hookBridge(getMethodId(0, 5), null ); } - //stub of arg size 0, index 6 + //stub of arg size 0, index 6 public static long stub_hook_6() throws Throwable { return hookBridge(getMethodId(0, 6), null ); } - //stub of arg size 0, index 7 + //stub of arg size 0, index 7 public static long stub_hook_7() throws Throwable { return hookBridge(getMethodId(0, 7), null ); } - //stub of arg size 0, index 8 + //stub of arg size 0, index 8 public static long stub_hook_8() throws Throwable { return hookBridge(getMethodId(0, 8), null ); } - //stub of arg size 0, index 9 + //stub of arg size 0, index 9 public static long stub_hook_9() throws Throwable { return hookBridge(getMethodId(0, 9), null ); } - //stub of arg size 1, index 0 + //stub of arg size 1, index 0 public static long stub_hook_0(long a0) throws Throwable { return hookBridge(getMethodId(1, 0), null , a0); } - //stub of arg size 1, index 1 + //stub of arg size 1, index 1 public static long stub_hook_1(long a0) throws Throwable { return hookBridge(getMethodId(1, 1), null , a0); } - //stub of arg size 1, index 2 + //stub of arg size 1, index 2 public static long stub_hook_2(long a0) throws Throwable { return hookBridge(getMethodId(1, 2), null , a0); } - //stub of arg size 1, index 3 + //stub of arg size 1, index 3 public static long stub_hook_3(long a0) throws Throwable { return hookBridge(getMethodId(1, 3), null , a0); } - //stub of arg size 1, index 4 + //stub of arg size 1, index 4 public static long stub_hook_4(long a0) throws Throwable { return hookBridge(getMethodId(1, 4), null , a0); } - //stub of arg size 1, index 5 + //stub of arg size 1, index 5 public static long stub_hook_5(long a0) throws Throwable { return hookBridge(getMethodId(1, 5), null , a0); } - //stub of arg size 1, index 6 + //stub of arg size 1, index 6 public static long stub_hook_6(long a0) throws Throwable { return hookBridge(getMethodId(1, 6), null , a0); } - //stub of arg size 1, index 7 + //stub of arg size 1, index 7 public static long stub_hook_7(long a0) throws Throwable { return hookBridge(getMethodId(1, 7), null , a0); } - //stub of arg size 1, index 8 + //stub of arg size 1, index 8 public static long stub_hook_8(long a0) throws Throwable { return hookBridge(getMethodId(1, 8), null , a0); } - //stub of arg size 1, index 9 + //stub of arg size 1, index 9 public static long stub_hook_9(long a0) throws Throwable { return hookBridge(getMethodId(1, 9), null , a0); } - //stub of arg size 1, index 10 + //stub of arg size 1, index 10 public static long stub_hook_10(long a0) throws Throwable { return hookBridge(getMethodId(1, 10), null , a0); } - //stub of arg size 1, index 11 + //stub of arg size 1, index 11 public static long stub_hook_11(long a0) throws Throwable { return hookBridge(getMethodId(1, 11), null , a0); } - //stub of arg size 1, index 12 + //stub of arg size 1, index 12 public static long stub_hook_12(long a0) throws Throwable { return hookBridge(getMethodId(1, 12), null , a0); } - //stub of arg size 1, index 13 + //stub of arg size 1, index 13 public static long stub_hook_13(long a0) throws Throwable { return hookBridge(getMethodId(1, 13), null , a0); } - //stub of arg size 1, index 14 + //stub of arg size 1, index 14 public static long stub_hook_14(long a0) throws Throwable { return hookBridge(getMethodId(1, 14), null , a0); } - //stub of arg size 1, index 15 + //stub of arg size 1, index 15 public static long stub_hook_15(long a0) throws Throwable { return hookBridge(getMethodId(1, 15), null , a0); } - //stub of arg size 1, index 16 + //stub of arg size 1, index 16 public static long stub_hook_16(long a0) throws Throwable { return hookBridge(getMethodId(1, 16), null , a0); } - //stub of arg size 1, index 17 + //stub of arg size 1, index 17 public static long stub_hook_17(long a0) throws Throwable { return hookBridge(getMethodId(1, 17), null , a0); } - //stub of arg size 1, index 18 + //stub of arg size 1, index 18 public static long stub_hook_18(long a0) throws Throwable { return hookBridge(getMethodId(1, 18), null , a0); } - //stub of arg size 1, index 19 + //stub of arg size 1, index 19 public static long stub_hook_19(long a0) throws Throwable { return hookBridge(getMethodId(1, 19), null , a0); } - //stub of arg size 2, index 0 + //stub of arg size 2, index 0 public static long stub_hook_0(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 0), null , a0, a1); } - //stub of arg size 2, index 1 + //stub of arg size 2, index 1 public static long stub_hook_1(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 1), null , a0, a1); } - //stub of arg size 2, index 2 + //stub of arg size 2, index 2 public static long stub_hook_2(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 2), null , a0, a1); } - //stub of arg size 2, index 3 + //stub of arg size 2, index 3 public static long stub_hook_3(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 3), null , a0, a1); } - //stub of arg size 2, index 4 + //stub of arg size 2, index 4 public static long stub_hook_4(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 4), null , a0, a1); } - //stub of arg size 2, index 5 + //stub of arg size 2, index 5 public static long stub_hook_5(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 5), null , a0, a1); } - //stub of arg size 2, index 6 + //stub of arg size 2, index 6 public static long stub_hook_6(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 6), null , a0, a1); } - //stub of arg size 2, index 7 + //stub of arg size 2, index 7 public static long stub_hook_7(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 7), null , a0, a1); } - //stub of arg size 2, index 8 + //stub of arg size 2, index 8 public static long stub_hook_8(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 8), null , a0, a1); } - //stub of arg size 2, index 9 + //stub of arg size 2, index 9 public static long stub_hook_9(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 9), null , a0, a1); } - //stub of arg size 2, index 10 + //stub of arg size 2, index 10 public static long stub_hook_10(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 10), null , a0, a1); } - //stub of arg size 2, index 11 + //stub of arg size 2, index 11 public static long stub_hook_11(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 11), null , a0, a1); } - //stub of arg size 2, index 12 + //stub of arg size 2, index 12 public static long stub_hook_12(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 12), null , a0, a1); } - //stub of arg size 2, index 13 + //stub of arg size 2, index 13 public static long stub_hook_13(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 13), null , a0, a1); } - //stub of arg size 2, index 14 + //stub of arg size 2, index 14 public static long stub_hook_14(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 14), null , a0, a1); } - //stub of arg size 2, index 15 + //stub of arg size 2, index 15 public static long stub_hook_15(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 15), null , a0, a1); } - //stub of arg size 2, index 16 + //stub of arg size 2, index 16 public static long stub_hook_16(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 16), null , a0, a1); } - //stub of arg size 2, index 17 + //stub of arg size 2, index 17 public static long stub_hook_17(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 17), null , a0, a1); } - //stub of arg size 2, index 18 + //stub of arg size 2, index 18 public static long stub_hook_18(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 18), null , a0, a1); } - //stub of arg size 2, index 19 + //stub of arg size 2, index 19 public static long stub_hook_19(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 19), null , a0, a1); } - //stub of arg size 2, index 20 + //stub of arg size 2, index 20 public static long stub_hook_20(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 20), null , a0, a1); } - //stub of arg size 2, index 21 + //stub of arg size 2, index 21 public static long stub_hook_21(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 21), null , a0, a1); } - //stub of arg size 2, index 22 + //stub of arg size 2, index 22 public static long stub_hook_22(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 22), null , a0, a1); } - //stub of arg size 2, index 23 + //stub of arg size 2, index 23 public static long stub_hook_23(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 23), null , a0, a1); } - //stub of arg size 2, index 24 + //stub of arg size 2, index 24 public static long stub_hook_24(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 24), null , a0, a1); } - //stub of arg size 2, index 25 + //stub of arg size 2, index 25 public static long stub_hook_25(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 25), null , a0, a1); } - //stub of arg size 2, index 26 + //stub of arg size 2, index 26 public static long stub_hook_26(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 26), null , a0, a1); } - //stub of arg size 2, index 27 + //stub of arg size 2, index 27 public static long stub_hook_27(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 27), null , a0, a1); } - //stub of arg size 2, index 28 + //stub of arg size 2, index 28 public static long stub_hook_28(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 28), null , a0, a1); } - //stub of arg size 2, index 29 + //stub of arg size 2, index 29 public static long stub_hook_29(long a0, long a1) throws Throwable { return hookBridge(getMethodId(2, 29), null , a0, a1); } - //stub of arg size 3, index 0 + //stub of arg size 3, index 0 public static long stub_hook_0(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 0), null , a0, a1, a2); } - //stub of arg size 3, index 1 + //stub of arg size 3, index 1 public static long stub_hook_1(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 1), null , a0, a1, a2); } - //stub of arg size 3, index 2 + //stub of arg size 3, index 2 public static long stub_hook_2(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 2), null , a0, a1, a2); } - //stub of arg size 3, index 3 + //stub of arg size 3, index 3 public static long stub_hook_3(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 3), null , a0, a1, a2); } - //stub of arg size 3, index 4 + //stub of arg size 3, index 4 public static long stub_hook_4(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 4), null , a0, a1, a2); } - //stub of arg size 3, index 5 + //stub of arg size 3, index 5 public static long stub_hook_5(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 5), null , a0, a1, a2); } - //stub of arg size 3, index 6 + //stub of arg size 3, index 6 public static long stub_hook_6(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 6), null , a0, a1, a2); } - //stub of arg size 3, index 7 + //stub of arg size 3, index 7 public static long stub_hook_7(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 7), null , a0, a1, a2); } - //stub of arg size 3, index 8 + //stub of arg size 3, index 8 public static long stub_hook_8(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 8), null , a0, a1, a2); } - //stub of arg size 3, index 9 + //stub of arg size 3, index 9 public static long stub_hook_9(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 9), null , a0, a1, a2); } - //stub of arg size 3, index 10 + //stub of arg size 3, index 10 public static long stub_hook_10(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 10), null , a0, a1, a2); } - //stub of arg size 3, index 11 + //stub of arg size 3, index 11 public static long stub_hook_11(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 11), null , a0, a1, a2); } - //stub of arg size 3, index 12 + //stub of arg size 3, index 12 public static long stub_hook_12(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 12), null , a0, a1, a2); } - //stub of arg size 3, index 13 + //stub of arg size 3, index 13 public static long stub_hook_13(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 13), null , a0, a1, a2); } - //stub of arg size 3, index 14 + //stub of arg size 3, index 14 public static long stub_hook_14(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 14), null , a0, a1, a2); } - //stub of arg size 3, index 15 + //stub of arg size 3, index 15 public static long stub_hook_15(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 15), null , a0, a1, a2); } - //stub of arg size 3, index 16 + //stub of arg size 3, index 16 public static long stub_hook_16(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 16), null , a0, a1, a2); } - //stub of arg size 3, index 17 + //stub of arg size 3, index 17 public static long stub_hook_17(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 17), null , a0, a1, a2); } - //stub of arg size 3, index 18 + //stub of arg size 3, index 18 public static long stub_hook_18(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 18), null , a0, a1, a2); } - //stub of arg size 3, index 19 + //stub of arg size 3, index 19 public static long stub_hook_19(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 19), null , a0, a1, a2); } - //stub of arg size 3, index 20 + //stub of arg size 3, index 20 public static long stub_hook_20(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 20), null , a0, a1, a2); } - //stub of arg size 3, index 21 + //stub of arg size 3, index 21 public static long stub_hook_21(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 21), null , a0, a1, a2); } - //stub of arg size 3, index 22 + //stub of arg size 3, index 22 public static long stub_hook_22(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 22), null , a0, a1, a2); } - //stub of arg size 3, index 23 + //stub of arg size 3, index 23 public static long stub_hook_23(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 23), null , a0, a1, a2); } - //stub of arg size 3, index 24 + //stub of arg size 3, index 24 public static long stub_hook_24(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 24), null , a0, a1, a2); } - //stub of arg size 3, index 25 + //stub of arg size 3, index 25 public static long stub_hook_25(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 25), null , a0, a1, a2); } - //stub of arg size 3, index 26 + //stub of arg size 3, index 26 public static long stub_hook_26(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 26), null , a0, a1, a2); } - //stub of arg size 3, index 27 + //stub of arg size 3, index 27 public static long stub_hook_27(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 27), null , a0, a1, a2); } - //stub of arg size 3, index 28 + //stub of arg size 3, index 28 public static long stub_hook_28(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 28), null , a0, a1, a2); } - //stub of arg size 3, index 29 + //stub of arg size 3, index 29 public static long stub_hook_29(long a0, long a1, long a2) throws Throwable { return hookBridge(getMethodId(3, 29), null , a0, a1, a2); } - //stub of arg size 4, index 0 + //stub of arg size 4, index 0 public static long stub_hook_0(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 0), null , a0, a1, a2, a3); } - //stub of arg size 4, index 1 + //stub of arg size 4, index 1 public static long stub_hook_1(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 1), null , a0, a1, a2, a3); } - //stub of arg size 4, index 2 + //stub of arg size 4, index 2 public static long stub_hook_2(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 2), null , a0, a1, a2, a3); } - //stub of arg size 4, index 3 + //stub of arg size 4, index 3 public static long stub_hook_3(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 3), null , a0, a1, a2, a3); } - //stub of arg size 4, index 4 + //stub of arg size 4, index 4 public static long stub_hook_4(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 4), null , a0, a1, a2, a3); } - //stub of arg size 4, index 5 + //stub of arg size 4, index 5 public static long stub_hook_5(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 5), null , a0, a1, a2, a3); } - //stub of arg size 4, index 6 + //stub of arg size 4, index 6 public static long stub_hook_6(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 6), null , a0, a1, a2, a3); } - //stub of arg size 4, index 7 + //stub of arg size 4, index 7 public static long stub_hook_7(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 7), null , a0, a1, a2, a3); } - //stub of arg size 4, index 8 + //stub of arg size 4, index 8 public static long stub_hook_8(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 8), null , a0, a1, a2, a3); } - //stub of arg size 4, index 9 + //stub of arg size 4, index 9 public static long stub_hook_9(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 9), null , a0, a1, a2, a3); } - //stub of arg size 4, index 10 + //stub of arg size 4, index 10 public static long stub_hook_10(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 10), null , a0, a1, a2, a3); } - //stub of arg size 4, index 11 + //stub of arg size 4, index 11 public static long stub_hook_11(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 11), null , a0, a1, a2, a3); } - //stub of arg size 4, index 12 + //stub of arg size 4, index 12 public static long stub_hook_12(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 12), null , a0, a1, a2, a3); } - //stub of arg size 4, index 13 + //stub of arg size 4, index 13 public static long stub_hook_13(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 13), null , a0, a1, a2, a3); } - //stub of arg size 4, index 14 + //stub of arg size 4, index 14 public static long stub_hook_14(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 14), null , a0, a1, a2, a3); } - //stub of arg size 4, index 15 + //stub of arg size 4, index 15 public static long stub_hook_15(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 15), null , a0, a1, a2, a3); } - //stub of arg size 4, index 16 + //stub of arg size 4, index 16 public static long stub_hook_16(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 16), null , a0, a1, a2, a3); } - //stub of arg size 4, index 17 + //stub of arg size 4, index 17 public static long stub_hook_17(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 17), null , a0, a1, a2, a3); } - //stub of arg size 4, index 18 + //stub of arg size 4, index 18 public static long stub_hook_18(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 18), null , a0, a1, a2, a3); } - //stub of arg size 4, index 19 + //stub of arg size 4, index 19 public static long stub_hook_19(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 19), null , a0, a1, a2, a3); } - //stub of arg size 4, index 20 + //stub of arg size 4, index 20 public static long stub_hook_20(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 20), null , a0, a1, a2, a3); } - //stub of arg size 4, index 21 + //stub of arg size 4, index 21 public static long stub_hook_21(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 21), null , a0, a1, a2, a3); } - //stub of arg size 4, index 22 + //stub of arg size 4, index 22 public static long stub_hook_22(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 22), null , a0, a1, a2, a3); } - //stub of arg size 4, index 23 + //stub of arg size 4, index 23 public static long stub_hook_23(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 23), null , a0, a1, a2, a3); } - //stub of arg size 4, index 24 + //stub of arg size 4, index 24 public static long stub_hook_24(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 24), null , a0, a1, a2, a3); } - //stub of arg size 4, index 25 + //stub of arg size 4, index 25 public static long stub_hook_25(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 25), null , a0, a1, a2, a3); } - //stub of arg size 4, index 26 + //stub of arg size 4, index 26 public static long stub_hook_26(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 26), null , a0, a1, a2, a3); } - //stub of arg size 4, index 27 + //stub of arg size 4, index 27 public static long stub_hook_27(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 27), null , a0, a1, a2, a3); } - //stub of arg size 4, index 28 + //stub of arg size 4, index 28 public static long stub_hook_28(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 28), null , a0, a1, a2, a3); } - //stub of arg size 4, index 29 + //stub of arg size 4, index 29 public static long stub_hook_29(long a0, long a1, long a2, long a3) throws Throwable { return hookBridge(getMethodId(4, 29), null , a0, a1, a2, a3); } - //stub of arg size 5, index 0 + //stub of arg size 5, index 0 public static long stub_hook_0(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 0), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 1 + //stub of arg size 5, index 1 public static long stub_hook_1(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 1), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 2 + //stub of arg size 5, index 2 public static long stub_hook_2(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 2), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 3 + //stub of arg size 5, index 3 public static long stub_hook_3(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 3), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 4 + //stub of arg size 5, index 4 public static long stub_hook_4(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 4), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 5 + //stub of arg size 5, index 5 public static long stub_hook_5(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 5), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 6 + //stub of arg size 5, index 6 public static long stub_hook_6(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 6), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 7 + //stub of arg size 5, index 7 public static long stub_hook_7(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 7), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 8 + //stub of arg size 5, index 8 public static long stub_hook_8(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 8), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 9 + //stub of arg size 5, index 9 public static long stub_hook_9(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 9), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 10 + //stub of arg size 5, index 10 public static long stub_hook_10(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 10), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 11 + //stub of arg size 5, index 11 public static long stub_hook_11(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 11), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 12 + //stub of arg size 5, index 12 public static long stub_hook_12(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 12), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 13 + //stub of arg size 5, index 13 public static long stub_hook_13(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 13), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 14 + //stub of arg size 5, index 14 public static long stub_hook_14(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 14), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 15 + //stub of arg size 5, index 15 public static long stub_hook_15(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 15), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 16 + //stub of arg size 5, index 16 public static long stub_hook_16(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 16), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 17 + //stub of arg size 5, index 17 public static long stub_hook_17(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 17), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 18 + //stub of arg size 5, index 18 public static long stub_hook_18(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 18), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 19 + //stub of arg size 5, index 19 public static long stub_hook_19(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 19), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 20 + //stub of arg size 5, index 20 public static long stub_hook_20(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 20), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 21 + //stub of arg size 5, index 21 public static long stub_hook_21(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 21), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 22 + //stub of arg size 5, index 22 public static long stub_hook_22(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 22), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 23 + //stub of arg size 5, index 23 public static long stub_hook_23(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 23), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 24 + //stub of arg size 5, index 24 public static long stub_hook_24(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 24), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 25 + //stub of arg size 5, index 25 public static long stub_hook_25(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 25), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 26 + //stub of arg size 5, index 26 public static long stub_hook_26(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 26), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 27 + //stub of arg size 5, index 27 public static long stub_hook_27(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 27), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 28 + //stub of arg size 5, index 28 public static long stub_hook_28(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 28), null , a0, a1, a2, a3, a4); } - //stub of arg size 5, index 29 + //stub of arg size 5, index 29 public static long stub_hook_29(long a0, long a1, long a2, long a3, long a4) throws Throwable { return hookBridge(getMethodId(5, 29), null , a0, a1, a2, a3, a4); } - //stub of arg size 6, index 0 + //stub of arg size 6, index 0 public static long stub_hook_0(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 0), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 1 + //stub of arg size 6, index 1 public static long stub_hook_1(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 1), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 2 + //stub of arg size 6, index 2 public static long stub_hook_2(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 2), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 3 + //stub of arg size 6, index 3 public static long stub_hook_3(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 3), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 4 + //stub of arg size 6, index 4 public static long stub_hook_4(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 4), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 5 + //stub of arg size 6, index 5 public static long stub_hook_5(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 5), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 6 + //stub of arg size 6, index 6 public static long stub_hook_6(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 6), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 7 + //stub of arg size 6, index 7 public static long stub_hook_7(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 7), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 8 + //stub of arg size 6, index 8 public static long stub_hook_8(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 8), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 9 + //stub of arg size 6, index 9 public static long stub_hook_9(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 9), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 10 + //stub of arg size 6, index 10 public static long stub_hook_10(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 10), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 11 + //stub of arg size 6, index 11 public static long stub_hook_11(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 11), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 12 + //stub of arg size 6, index 12 public static long stub_hook_12(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 12), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 13 + //stub of arg size 6, index 13 public static long stub_hook_13(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 13), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 14 + //stub of arg size 6, index 14 public static long stub_hook_14(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 14), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 15 + //stub of arg size 6, index 15 public static long stub_hook_15(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 15), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 16 + //stub of arg size 6, index 16 public static long stub_hook_16(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 16), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 17 + //stub of arg size 6, index 17 public static long stub_hook_17(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 17), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 18 + //stub of arg size 6, index 18 public static long stub_hook_18(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 18), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 19 + //stub of arg size 6, index 19 public static long stub_hook_19(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 19), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 20 + //stub of arg size 6, index 20 public static long stub_hook_20(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 20), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 21 + //stub of arg size 6, index 21 public static long stub_hook_21(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 21), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 22 + //stub of arg size 6, index 22 public static long stub_hook_22(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 22), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 23 + //stub of arg size 6, index 23 public static long stub_hook_23(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 23), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 24 + //stub of arg size 6, index 24 public static long stub_hook_24(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 24), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 25 + //stub of arg size 6, index 25 public static long stub_hook_25(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 25), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 26 + //stub of arg size 6, index 26 public static long stub_hook_26(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 26), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 27 + //stub of arg size 6, index 27 public static long stub_hook_27(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 27), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 28 + //stub of arg size 6, index 28 public static long stub_hook_28(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 28), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 6, index 29 + //stub of arg size 6, index 29 public static long stub_hook_29(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return hookBridge(getMethodId(6, 29), null , a0, a1, a2, a3, a4, a5); } - //stub of arg size 7, index 0 + //stub of arg size 6, index 30 + public static long stub_hook_30(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 30), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 31 + public static long stub_hook_31(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 31), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 32 + public static long stub_hook_32(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 32), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 33 + public static long stub_hook_33(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 33), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 34 + public static long stub_hook_34(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 34), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 35 + public static long stub_hook_35(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 35), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 36 + public static long stub_hook_36(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 36), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 37 + public static long stub_hook_37(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 37), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 38 + public static long stub_hook_38(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 38), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 39 + public static long stub_hook_39(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 39), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 40 + public static long stub_hook_40(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 40), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 41 + public static long stub_hook_41(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 41), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 42 + public static long stub_hook_42(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 42), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 43 + public static long stub_hook_43(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 43), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 44 + public static long stub_hook_44(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 44), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 45 + public static long stub_hook_45(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 45), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 46 + public static long stub_hook_46(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 46), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 47 + public static long stub_hook_47(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 47), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 48 + public static long stub_hook_48(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 48), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 6, index 49 + public static long stub_hook_49(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { + return hookBridge(getMethodId(6, 49), null , a0, a1, a2, a3, a4, a5); + } + + + //stub of arg size 7, index 0 public static long stub_hook_0(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 0), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 1 + //stub of arg size 7, index 1 public static long stub_hook_1(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 1), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 2 + //stub of arg size 7, index 2 public static long stub_hook_2(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 2), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 3 + //stub of arg size 7, index 3 public static long stub_hook_3(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 3), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 4 + //stub of arg size 7, index 4 public static long stub_hook_4(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 4), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 5 + //stub of arg size 7, index 5 public static long stub_hook_5(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 5), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 6 + //stub of arg size 7, index 6 public static long stub_hook_6(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 6), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 7 + //stub of arg size 7, index 7 public static long stub_hook_7(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 7), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 8 + //stub of arg size 7, index 8 public static long stub_hook_8(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 8), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 9 + //stub of arg size 7, index 9 public static long stub_hook_9(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 9), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 10 + //stub of arg size 7, index 10 public static long stub_hook_10(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 10), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 11 + //stub of arg size 7, index 11 public static long stub_hook_11(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 11), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 12 + //stub of arg size 7, index 12 public static long stub_hook_12(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 12), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 13 + //stub of arg size 7, index 13 public static long stub_hook_13(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 13), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 14 + //stub of arg size 7, index 14 public static long stub_hook_14(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 14), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 15 + //stub of arg size 7, index 15 public static long stub_hook_15(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 15), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 16 + //stub of arg size 7, index 16 public static long stub_hook_16(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 16), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 17 + //stub of arg size 7, index 17 public static long stub_hook_17(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 17), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 18 + //stub of arg size 7, index 18 public static long stub_hook_18(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 18), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 7, index 19 + //stub of arg size 7, index 19 public static long stub_hook_19(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return hookBridge(getMethodId(7, 19), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 8, index 0 - public static long stub_hook_0(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { - return hookBridge(getMethodId(8, 0), null , a0, a1, a2, a3, a4, a5, a6, a7); + //stub of arg size 7, index 20 + public static long stub_hook_20(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 20), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 8, index 1 - public static long stub_hook_1(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { - return hookBridge(getMethodId(8, 1), null , a0, a1, a2, a3, a4, a5, a6, a7); + //stub of arg size 7, index 21 + public static long stub_hook_21(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 21), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 8, index 2 - public static long stub_hook_2(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { - return hookBridge(getMethodId(8, 2), null , a0, a1, a2, a3, a4, a5, a6, a7); + //stub of arg size 7, index 22 + public static long stub_hook_22(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 22), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 8, index 3 - public static long stub_hook_3(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { - return hookBridge(getMethodId(8, 3), null , a0, a1, a2, a3, a4, a5, a6, a7); + //stub of arg size 7, index 23 + public static long stub_hook_23(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 23), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 8, index 4 - public static long stub_hook_4(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { - return hookBridge(getMethodId(8, 4), null , a0, a1, a2, a3, a4, a5, a6, a7); + //stub of arg size 7, index 24 + public static long stub_hook_24(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 24), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 8, index 5 - public static long stub_hook_5(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { - return hookBridge(getMethodId(8, 5), null , a0, a1, a2, a3, a4, a5, a6, a7); + //stub of arg size 7, index 25 + public static long stub_hook_25(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 25), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 8, index 6 - public static long stub_hook_6(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { - return hookBridge(getMethodId(8, 6), null , a0, a1, a2, a3, a4, a5, a6, a7); + //stub of arg size 7, index 26 + public static long stub_hook_26(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 26), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 8, index 7 - public static long stub_hook_7(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { - return hookBridge(getMethodId(8, 7), null , a0, a1, a2, a3, a4, a5, a6, a7); + //stub of arg size 7, index 27 + public static long stub_hook_27(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 27), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 8, index 8 - public static long stub_hook_8(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { - return hookBridge(getMethodId(8, 8), null , a0, a1, a2, a3, a4, a5, a6, a7); + //stub of arg size 7, index 28 + public static long stub_hook_28(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 28), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 8, index 9 - public static long stub_hook_9(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { - return hookBridge(getMethodId(8, 9), null , a0, a1, a2, a3, a4, a5, a6, a7); + //stub of arg size 7, index 29 + public static long stub_hook_29(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 29), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 9, index 0 - public static long stub_hook_0(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { - return hookBridge(getMethodId(9, 0), null , a0, a1, a2, a3, a4, a5, a6, a7, a8); + //stub of arg size 7, index 30 + public static long stub_hook_30(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 30), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 9, index 1 - public static long stub_hook_1(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { - return hookBridge(getMethodId(9, 1), null , a0, a1, a2, a3, a4, a5, a6, a7, a8); + //stub of arg size 7, index 31 + public static long stub_hook_31(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 31), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 9, index 2 - public static long stub_hook_2(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { - return hookBridge(getMethodId(9, 2), null , a0, a1, a2, a3, a4, a5, a6, a7, a8); + //stub of arg size 7, index 32 + public static long stub_hook_32(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 32), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 9, index 3 - public static long stub_hook_3(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { - return hookBridge(getMethodId(9, 3), null , a0, a1, a2, a3, a4, a5, a6, a7, a8); + //stub of arg size 7, index 33 + public static long stub_hook_33(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 33), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 9, index 4 - public static long stub_hook_4(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { - return hookBridge(getMethodId(9, 4), null , a0, a1, a2, a3, a4, a5, a6, a7, a8); + //stub of arg size 7, index 34 + public static long stub_hook_34(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 34), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 9, index 5 - public static long stub_hook_5(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { - return hookBridge(getMethodId(9, 5), null , a0, a1, a2, a3, a4, a5, a6, a7, a8); + //stub of arg size 7, index 35 + public static long stub_hook_35(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 35), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 9, index 6 - public static long stub_hook_6(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { - return hookBridge(getMethodId(9, 6), null , a0, a1, a2, a3, a4, a5, a6, a7, a8); + //stub of arg size 7, index 36 + public static long stub_hook_36(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 36), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 9, index 7 - public static long stub_hook_7(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { - return hookBridge(getMethodId(9, 7), null , a0, a1, a2, a3, a4, a5, a6, a7, a8); + //stub of arg size 7, index 37 + public static long stub_hook_37(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 37), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 9, index 8 - public static long stub_hook_8(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { - return hookBridge(getMethodId(9, 8), null , a0, a1, a2, a3, a4, a5, a6, a7, a8); + //stub of arg size 7, index 38 + public static long stub_hook_38(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 38), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 9, index 9 - public static long stub_hook_9(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { - return hookBridge(getMethodId(9, 9), null , a0, a1, a2, a3, a4, a5, a6, a7, a8); + //stub of arg size 7, index 39 + public static long stub_hook_39(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 39), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 10, index 0 - public static long stub_hook_0(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { - return hookBridge(getMethodId(10, 0), null , a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); + //stub of arg size 7, index 40 + public static long stub_hook_40(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 40), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 10, index 1 - public static long stub_hook_1(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { - return hookBridge(getMethodId(10, 1), null , a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); + //stub of arg size 7, index 41 + public static long stub_hook_41(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 41), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 10, index 2 - public static long stub_hook_2(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { - return hookBridge(getMethodId(10, 2), null , a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); + //stub of arg size 7, index 42 + public static long stub_hook_42(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 42), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 10, index 3 - public static long stub_hook_3(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { - return hookBridge(getMethodId(10, 3), null , a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); + //stub of arg size 7, index 43 + public static long stub_hook_43(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 43), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 10, index 4 - public static long stub_hook_4(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { - return hookBridge(getMethodId(10, 4), null , a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); + //stub of arg size 7, index 44 + public static long stub_hook_44(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 44), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 11, index 0 - public static long stub_hook_0(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9, long a10) throws Throwable { - return hookBridge(getMethodId(11, 0), null , a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + //stub of arg size 7, index 45 + public static long stub_hook_45(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 45), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 11, index 1 - public static long stub_hook_1(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9, long a10) throws Throwable { - return hookBridge(getMethodId(11, 1), null , a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + //stub of arg size 7, index 46 + public static long stub_hook_46(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 46), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 11, index 2 - public static long stub_hook_2(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9, long a10) throws Throwable { - return hookBridge(getMethodId(11, 2), null , a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + //stub of arg size 7, index 47 + public static long stub_hook_47(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 47), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 11, index 3 - public static long stub_hook_3(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9, long a10) throws Throwable { - return hookBridge(getMethodId(11, 3), null , a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + //stub of arg size 7, index 48 + public static long stub_hook_48(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 48), null , a0, a1, a2, a3, a4, a5, a6); } - //stub of arg size 11, index 4 - public static long stub_hook_4(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9, long a10) throws Throwable { - return hookBridge(getMethodId(11, 4), null , a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); - } - - - //stub of arg size 12, index 0 - public static long stub_hook_0(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9, long a10, long a11) throws Throwable { - return hookBridge(getMethodId(12, 0), null , a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); - } - - - //stub of arg size 12, index 1 - public static long stub_hook_1(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9, long a10, long a11) throws Throwable { - return hookBridge(getMethodId(12, 1), null , a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); - } - - - //stub of arg size 12, index 2 - public static long stub_hook_2(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9, long a10, long a11) throws Throwable { - return hookBridge(getMethodId(12, 2), null , a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + //stub of arg size 7, index 49 + public static long stub_hook_49(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { + return hookBridge(getMethodId(7, 49), null , a0, a1, a2, a3, a4, a5, a6); } } diff --git a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/methodgen/HookerDexMaker.java b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/methodgen/HookerDexMaker.java index 4a72537b..f5d410af 100644 --- a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/methodgen/HookerDexMaker.java +++ b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/methodgen/HookerDexMaker.java @@ -9,12 +9,15 @@ import com.swift.sandhook.xposedcompat.XposedCompat; import com.swift.sandhook.xposedcompat.utils.DexLog; import java.io.File; +import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.Member; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import java.nio.ByteBuffer; import java.util.Map; +import dalvik.system.InMemoryDexClassLoader; import de.robv.android.xposed.XC_MethodHook; import de.robv.android.xposed.XposedBridge; import external.com.android.dx.BinaryOp; @@ -218,7 +221,13 @@ public class HookerDexMaker implements HookMaker { throw new IllegalArgumentException("dexDirPath should not be empty!!!"); } // Create the dex file and load it. - loader = mDexMaker.generateAndLoad(mAppClassLoader, new File(mDexDirPath), dexName); + try { + loader = mDexMaker.generateAndLoad(mAppClassLoader, new File(mDexDirPath), dexName); + } catch (IOException e) { + //can not write file + byte[] dexBytes = mDexMaker.generate(); + loader = new InMemoryDexClassLoader(ByteBuffer.wrap(dexBytes), mAppClassLoader); + } return loadHookerClass(loader, className); } diff --git a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/methodgen/HookerDexMakerNew.java b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/methodgen/HookerDexMakerNew.java index ebd99af4..38fad272 100644 --- a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/methodgen/HookerDexMakerNew.java +++ b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/methodgen/HookerDexMakerNew.java @@ -7,12 +7,15 @@ import com.swift.sandhook.wrapper.HookWrapper; import com.swift.sandhook.xposedcompat.hookstub.HookStubManager; import java.io.File; +import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.Member; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import java.nio.ByteBuffer; import java.util.Map; +import dalvik.system.InMemoryDexClassLoader; import de.robv.android.xposed.XposedBridge; import de.robv.android.xposed.XposedHelpers; import external.com.android.dx.Code; @@ -172,7 +175,13 @@ public class HookerDexMakerNew implements HookMaker { throw new IllegalArgumentException("dexDirPath should not be empty!!!"); } // Create the dex file and load it. - loader = mDexMaker.generateAndLoad(mAppClassLoader, new File(mDexDirPath), dexName); + try { + loader = mDexMaker.generateAndLoad(mAppClassLoader, new File(mDexDirPath), dexName); + } catch (IOException e) { + //can not write file + byte[] dexBytes = mDexMaker.generate(); + loader = new InMemoryDexClassLoader(ByteBuffer.wrap(dexBytes), mAppClassLoader); + } return loadHookerClass(loader, className); } @@ -233,7 +242,7 @@ public class HookerDexMakerNew implements HookMaker { Code code = mDexMaker.declare(mHookMethodId, Modifier.PUBLIC | Modifier.STATIC); Local method = code.newLocal(memberTypeId); - // Local backupMethod = code.newLocal(methodTypeId); + // Local backupMethod = code.newLocal(methodTypeId); Local thisObject = code.newLocal(TypeId.OBJECT); Local args = code.newLocal(objArrayTypeId); Local actualParamSize = code.newLocal(TypeId.INT); diff --git a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/methodgen/SandHookXposedBridge.java b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/methodgen/SandHookXposedBridge.java index 22227e44..39eea87d 100644 --- a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/methodgen/SandHookXposedBridge.java +++ b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/methodgen/SandHookXposedBridge.java @@ -3,7 +3,6 @@ package com.swift.sandhook.xposedcompat.methodgen; import android.os.Process; import android.os.Trace; -import com.elderdrivers.riru.edxp.Main; import com.swift.sandhook.SandHook; import com.swift.sandhook.SandHookConfig; import com.swift.sandhook.wrapper.HookWrapper; @@ -18,27 +17,23 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Member; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicBoolean; import de.robv.android.xposed.XposedBridge; -import static com.elderdrivers.riru.edxp.util.FileUtils.getDataPathPrefix; -import static com.elderdrivers.riru.edxp.util.FileUtils.getPackageName; -import static com.elderdrivers.riru.edxp.util.ProcessUtils.getCurrentProcessName; - public final class SandHookXposedBridge { - private static final HashMap hookedInfo = new HashMap<>(); - private static HookMaker hookMaker = XposedCompat.useNewDexMaker ? new HookerDexMakerNew() : new HookerDexMaker(); + private static final Map hookedInfo = new ConcurrentHashMap<>(); + private static HookMaker hookMaker = XposedCompat.useNewCallBackup ? new HookerDexMakerNew() : new HookerDexMaker(); private static final AtomicBoolean dexPathInited = new AtomicBoolean(false); private static File dexDir; - public static Map entityMap = new HashMap<>(); + public static Map entityMap = new ConcurrentHashMap<>(); - public static void onForkPost() { - dexPathInited.set(false); + public static boolean hooked(Member member) { + return hookedInfo.containsKey(member) || entityMap.containsKey(member); } public static synchronized void hookMethod(Member hookMethod, XposedBridge.AdditionalHookInfo additionalHookInfo) { @@ -53,8 +48,17 @@ public final class SandHookXposedBridge { } try { - setupDexCachePath(); - Trace.beginSection("SandHook-Xposed"); + if (dexPathInited.compareAndSet(false, true)) { + try { + String fixedAppDataDir = XposedCompat.getCacheDir().getAbsolutePath(); + dexDir = new File(fixedAppDataDir, "/hookers/"); + if (!dexDir.exists()) + dexDir.mkdirs(); + } catch (Throwable throwable) { + DexLog.e("error when init dex path", throwable); + } + } + Trace.beginSection("SandXposed"); long timeStart = System.currentTimeMillis(); HookMethodEntity stub = null; if (XposedCompat.useInternalStub) { @@ -65,7 +69,7 @@ public final class SandHookXposedBridge { entityMap.put(hookMethod, stub); } else { hookMaker.start(hookMethod, additionalHookInfo, - null, dexDir == null ? null : dexDir.getAbsolutePath()); + hookMethod.getDeclaringClass().getClassLoader(), dexDir == null ? null : dexDir.getAbsolutePath()); hookedInfo.put(hookMethod, hookMaker.getCallBackupMethod()); } DexLog.d("hook method <" + hookMethod.toString() + "> cost " + (System.currentTimeMillis() - timeStart) + " ms, by " + (stub != null ? "internal stub." : "dex maker")); @@ -75,35 +79,18 @@ public final class SandHookXposedBridge { } } - private static void setupDexCachePath() { - // using file based DexClassLoader - if (!dexPathInited.compareAndSet(false, true)) { + public static void clearOatFile() { + String fixedAppDataDir = XposedCompat.getCacheDir().getAbsolutePath(); + File dexOatDir = new File(fixedAppDataDir, "/hookers/oat/"); + if (!dexOatDir.exists()) return; - } try { - // we always choose to use device encrypted storage data on android N and later - // in case some app is installing hooks before phone is unlocked - String fixedAppDataDir = getDataPathPrefix() + getPackageName(Main.appDataDir) + "/"; - dexDir = new File(fixedAppDataDir, "/cache/sandxposed/" - + getCurrentProcessName(Main.appProcessName).replace(":", "_") + "/"); - dexDir.mkdirs(); + FileUtils.delete(dexOatDir); + dexOatDir.mkdirs(); } catch (Throwable throwable) { - com.elderdrivers.riru.edxp.sandhook.dexmaker.DexLog.e("error when init dex path", throwable); } } -// public static void clearOatFile() { -// String fixedAppDataDir = XposedCompat.cacheDir.getAbsolutePath(); -// File dexOatDir = new File(fixedAppDataDir, "/sandxposed/oat/"); -// if (!dexOatDir.exists()) -// return; -// try { -// FileUtils.delete(dexOatDir); -// dexOatDir.mkdirs(); -// } catch (Throwable throwable) { -// } -// } - private static boolean checkMember(Member member) { if (member instanceof Method) { @@ -124,37 +111,24 @@ public final class SandHookXposedBridge { public static Object invokeOriginalMethod(Member method, Object thisObject, Object[] args) throws Throwable { - Method callBackup = hookedInfo.get(method); - if (callBackup == null) { - //method hook use internal stub - return SandHook.callOriginMethod(method, thisObject, args); - } - if (!Modifier.isStatic(callBackup.getModifiers())) { - throw new IllegalStateException("original method is not static, something must be wrong!"); - } - callBackup.setAccessible(true); - if (args == null) { - args = new Object[0]; - } - final int argsSize = args.length; - if (Modifier.isStatic(method.getModifiers())) { - return callBackup.invoke(null, args); - } else { - Object[] newArgs = new Object[argsSize + 1]; - newArgs[0] = thisObject; - for (int i = 1; i < newArgs.length; i++) { - newArgs[i] = args[i - 1]; - } - return callBackup.invoke(null, newArgs); - } + return SandHook.callOriginMethod(method, thisObject, args); } - public static void setLibPath() { + public static void init() { if (Process.is64Bit()) { SandHookConfig.libSandHookPath = "/system/lib64/libsandhook.edxp.so"; } else { SandHookConfig.libSandHookPath = "/system/lib/libsandhook.edxp.so"; } + SandHookConfig.libLoader = new SandHookConfig.LibLoader() { + @Override + public void loadLib() { + //do it in loadDexAndInit + } + }; + SandHookConfig.DEBUG = true; + //in zygote disable compile + SandHookConfig.compiler = false; } } diff --git a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/utils/DexLog.java b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/utils/DexLog.java index cda8f193..9aefa888 100644 --- a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/utils/DexLog.java +++ b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/utils/DexLog.java @@ -7,12 +7,16 @@ import java.lang.reflect.Member; public class DexLog { - public static final String TAG = "SandXposed-dexmaker"; + public static final String TAG = "SandXposed"; - public static boolean DEBUG = true; + public static volatile boolean DEBUG = true; public static int v(String s) { - return Log.v(TAG, s); + if (DEBUG) { + return Log.v(TAG, s); + } else { + return 0; + } } public static int i(String s) { @@ -25,26 +29,38 @@ public class DexLog { public static void printMethodHookIn(Member member) { if (DEBUG && member != null) { - Log.d("SandHook-Xposed", "method <" + member.toString() + "> hook in"); + Log.d("SandHook", "method <" + member.toString() + "> hook in"); } } public static void printCallOriginError(Member member) { - if (member != null) { - Log.e("SandHook-Xposed", "method <" + member.toString() + "> call origin error!"); + if (DEBUG && member != null) { + Log.d("SandHook", "method <" + member.toString() + "> call origin error!"); } } public static int w(String s) { - return Log.w(TAG, s); + if (DEBUG) { + return Log.w(TAG, s); + } else { + return 0; + } } public static int e(String s) { - return Log.e(TAG, s); + if (DEBUG) { + return Log.e(TAG, s); + } else { + return 0; + } } public static int e(String s, Throwable t) { - return Log.e(TAG, s, t); + if (DEBUG) { + return Log.e(TAG, s, t); + } else { + return 0; + } } diff --git a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/utils/ProcessUtils.java b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/utils/ProcessUtils.java index 2adcf4f3..11d80101 100644 --- a/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/utils/ProcessUtils.java +++ b/edxp-sandhook/src/main/java/com/swift/sandhook/xposedcompat/utils/ProcessUtils.java @@ -5,8 +5,12 @@ import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; +import android.os.Process; import android.text.TextUtils; +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; @@ -18,10 +22,10 @@ public class ProcessUtils { private static volatile String processName = null; - public static String getProcessName(Context context) { + public static String getProcessName() { if (!TextUtils.isEmpty(processName)) return processName; - processName = doGetProcessName(context); + processName = getProcessName(Process.myPid()); return processName; } @@ -41,8 +45,35 @@ public class ProcessUtils { return context.getPackageName(); } + public static String getProcessName(int pid) { + BufferedReader cmdlineReader = null; + try { + cmdlineReader = new BufferedReader(new InputStreamReader( + new FileInputStream( + "/proc/" + pid + "/cmdline"), + "iso-8859-1")); + int c; + StringBuilder processName = new StringBuilder(); + while ((c = cmdlineReader.read()) > 0) { + processName.append((char) c); + } + return processName.toString(); + } catch (Throwable throwable) { + DexLog.w("getProcessName: " + throwable.getMessage()); + } finally { + try { + if (cmdlineReader != null) { + cmdlineReader.close(); + } + } catch (Throwable throwable) { + DexLog.e("getProcessName: " + throwable.getMessage()); + } + } + return ""; + } + public static boolean isMainProcess(Context context) { - String processName = getProcessName(context); + String processName = getProcessName(); String pkgName = context.getPackageName(); if (!TextUtils.isEmpty(processName) && !TextUtils.equals(processName, pkgName)) { return false; diff --git a/edxp-sandhook/template_override/system/etc/public.libraries-edxp.txt b/edxp-sandhook/template_override/system/etc/public.libraries-edxp.txt deleted file mode 100644 index 3c8badba..00000000 --- a/edxp-sandhook/template_override/system/etc/public.libraries-edxp.txt +++ /dev/null @@ -1 +0,0 @@ -libsandhook.edxp.so diff --git a/edxp-sandhook/template_override/system/lib/libsandhook.edxp.so b/edxp-sandhook/template_override/system/lib/libsandhook.edxp.so old mode 100644 new mode 100755 index 82321291..f624bc63 Binary files a/edxp-sandhook/template_override/system/lib/libsandhook.edxp.so and b/edxp-sandhook/template_override/system/lib/libsandhook.edxp.so differ diff --git a/edxp-sandhook/template_override/system/lib64/libsandhook.edxp.so b/edxp-sandhook/template_override/system/lib64/libsandhook.edxp.so old mode 100644 new mode 100755 index cca107d3..24c09849 Binary files a/edxp-sandhook/template_override/system/lib64/libsandhook.edxp.so and b/edxp-sandhook/template_override/system/lib64/libsandhook.edxp.so differ