-
-
Save bitqiu/a6a57467de63b62ce7a34920685c0140 to your computer and use it in GitHub Desktop.
roysue分享的xposed万能代码
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 被hook的app的包名 | |
| String hookedPackageName = "com.xekvhaDYe.androie"; | |
| // app里面的Activity | |
| String hookedActivityName = "com.xekvhaDYu.android.a.MainActivity"; | |
| if (hookedPackageName.equals(lpparam.packageName)) { | |
| XposedBridge.log("has hooked..."); | |
| XposedBridge.log("inner => " + lpparam.processName); | |
| Class ActivityThread = XposedHelpers.findClass("android.app.ActivityThread", lpparam.classLoader); | |
| XposedBridge.hookAllMethods(ActivityThread, "performLaunchActivity", new XC_MethodHook() { | |
| @Override | |
| protected void afterHookedMethod(MethodHookParam param) throws Throwable { | |
| super.afterHookedMethod(param); | |
| Object mInitialApplication = (Application) XposedHelpers.getObjectField(param.thisObject, "mInitialApplication"); | |
| ClassLoader finalCL = (ClassLoader) XposedHelpers.callMethod(mInitialApplication, "getClassLoader"); | |
| XposedBridge.log("found classload is => " + finalCL.toString()); | |
| Class BabyMain = (Class) XposedHelpers.callMethod(finalCL, "findClass", hookedActivityName); | |
| XposedBridge.log("found final class is => " + BabyMain.getName().toString()); | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment