alibaba / dexposed

dexposed enable 'god' mode for single android application.
4.51k stars 1.07k forks source link

Patch成功,但是Hook的函数没有被替换 #62

Closed Ruowenmei closed 8 years ago

Ruowenmei commented 8 years ago

执行时,有系统异常,提示如下: `DexOpt: --- BEGIN 'patch_my.apk' (bootstrap=0) --- 02-18 18:14:03.712 26653-26653/com.ruowen.hookdexposed D/dalvikvm﹕ DexOpt: --- END 'patch_my.apk' (success) --- 02-18 18:14:03.712 26653-26653/com.ruowen.hookdexposed D/dalvikvm﹕ DEX prep '/storage/emulated/0/Android/data/com.ruowen.hookdexposed/cache/patch_my.apk': unzip in 0ms, rewrite 99ms 02-18 18:14:03.722 26653-26653/com.ruowen.hookdexposed D/dalvikvm﹕ DexOpt: --- BEGIN 'patch_my.apk' (bootstrap=0) --- 02-18 18:14:03.812 26653-26653/com.ruowen.hookdexposed D/dalvikvm﹕ DexOpt: --- END 'patch_my.apk' (success) --- 02-18 18:14:03.812 26653-26653/com.ruowen.hookdexposed D/dalvikvm﹕ DEX prep '/storage/emulated/0/Android/data/com.ruowen.hookdexposed/cache/patch_my.apk': unzip in 0ms, rewrite 91ms

/*此处提示有未实现的本地方法******/ 02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/dalvikvm﹕ No implementation found for native Lcom/taobao/android/dexposed/DexposedBridge;.hookMethodNative:(Ljava/lang/reflect/Member;Ljava/lang/Class;ILjava/lang/Object;)V 02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/System.err﹕ java.lang.UnsatisfiedLinkError: Native method not found: com.taobao.android.dexposed.DexposedBridge.hookMethodNative:(Ljava/lang/reflect/Member;Ljava/lang/Class;ILjava/lang/Object;)V /****此处提示有未实现的本地方法*******/

02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at com.taobao.android.dexposed.DexposedBridge.hookMethodNative(Native Method) 02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at com.taobao.android.dexposed.DexposedBridge.hookMethod(DexposedBridge.java:158) 02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at com.taobao.android.dexposed.DexposedBridge.findAndHookMethod(DexposedBridge.java:192) 02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at com.taobao.patch.BtnClickPatch.handlePatch(BtnClickPatch.java:24) 02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at com.taobao.patch.PatchCallback.handlePatch(PatchCallback.java:35) 02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at com.taobao.patch.PatchCallback.call(PatchCallback.java:31) 02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at com.taobao.patch.PatchCallback.callAll(PatchCallback.java:16) 02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at com.taobao.patch.PatchMain.load(PatchMain.java:95) 02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at com.ruowen.hookdexposed.MainActivity.runPatchApk(MainActivity.java:76) 02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at com.ruowen.hookdexposed.MainActivity.onClick(MainActivity.java:52) 02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at android.view.View.performClick(View.java:4444) 02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at android.view.View$PerformClick.run(View.java:18457) 02-18 18:14:03.822 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:733) 02-18 18:14:03.832 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:95) 02-18 18:14:03.832 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at android.os.Looper.loop(Looper.java:136) 02-18 18:14:03.832 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5049) 02-18 18:14:03.832 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method) 02-18 18:14:03.832 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:515) 02-18 18:14:03.832 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 02-18 18:14:03.832 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609) 02-18 18:14:03.832 26653-26653/com.ruowen.hookdexposed W/System.err﹕ at dalvik.system.NativeStart.main(Native Method) 02-18 18:14:03.832 26653-26653/com.ruowen.hookdexposed E/Hotpatch﹕ patch success!`

hwjump commented 8 years ago

It seem it didn't load so? Did you call DexposedBridge.canDexposed or call system.loadlibrary() your self?

Ruowenmei commented 8 years ago

I have execute this code:

static { // load xposed lib for hook. try { if (android.os.Build.VERSION.SDK_INT == 22){ System.loadLibrary("dexposed_l51"); } else if (android.os.Build.VERSION.SDK_INT > 19 && android.os.Build.VERSION.SDK_INT <= 21){ System.loadLibrary("dexposed_l"); } else if (android.os.Build.VERSION.SDK_INT > 14){ System.loadLibrary("dexposed"); } } catch (Throwable e) { e.printStackTrace(); } }

in my MainActivity, and my project content as below: qq 20160219142914

Ruowenmei commented 8 years ago

Sorry, I have found the problem. My so files are in the wrong position. The correct content as below: ![Uploading qw.png…]()

Thanks for your answer!