在课题中,需要让zygote进程自动加载一段dex文件并执行内部逻辑,一种办法是用Xposed方案,替换app_process,但此方案需要重启,而且有版本的局限性,另一种方案就是注入到zygote进程开启一段dex文件,但注入zygote进程后基本上都会死掉,会出现ClassNotFoundException,但是在dex文件中确实是定义了JavaHook类,哪位阔以给点提示呀!不胜感激!!!!
错误如下所示:
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
10-16 04:06:54.274: D/Dex_Injection(3034): step5: using [com.lwl.hook.JavaHook] class loaded above to find [setAppHook] method and invoke it...
10-16 04:06:54.274: W/dalvikvm(3034): JNI WARNING: JNI method called with exception pending
10-16 04:06:54.274: W/dalvikvm(3034): in Lcom/android/internal/os/ZygoteInit;.selectReadable:([Ljava/io/FileDescriptor;)I (GetStaticMethodID)
10-16 04:06:54.274: W/dalvikvm(3034): Pending exception is:
10-16 04:06:54.274: I/dalvikvm(3034): java.lang.ClassNotFoundException: com.lwl.hook.JavaHook
10-16 04:06:54.274: I/dalvikvm(3034): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
10-16 04:06:54.274: I/dalvikvm(3034): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
10-16 04:06:54.274: I/dalvikvm(3034): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
10-16 04:06:54.274: I/dalvikvm(3034): at com.android.internal.os.ZygoteInit.selectReadable(Native Method)
10-16 04:06:54.274: I/dalvikvm(3034): at com.android.internal.os.ZygoteInit.runSelectLoopMode(ZygoteInit.java:636)
10-16 04:06:54.274: I/dalvikvm(3034): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:546)
10-16 04:06:54.274: I/dalvikvm(3034): at dalvik.system.NativeStart.main(Native Method)
10-16 04:06:54.274: I/dalvikvm(3034): "main" prio=5 tid=1 NATIVE
10-16 04:06:54.274: I/dalvikvm(3034): | group="main" sCount=0 dsCount=0 obj=0x40997460 self=0x12810
10-16 04:06:54.274: I/dalvikvm(3034): | sysTid=3034 nice=0 sched=0/0 cgrp=default handle=1074082952
10-16 04:06:54.274: I/dalvikvm(3034): | schedstat=( 10902206229 3992090106 2303 ) utm=1001 stm=89 core=0
10-16 04:06:54.274: I/dalvikvm(3034): at com.android.internal.os.ZygoteInit.selectReadable(Native Method)
10-16 04:06:54.274: I/dalvikvm(3034): at com.android.internal.os.ZygoteInit.runSelectLoopMode(ZygoteInit.java:636)
10-16 04:06:54.274: I/dalvikvm(3034): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:546)
10-16 04:06:54.274: I/dalvikvm(3034): at dalvik.system.NativeStart.main(Native Method)
10-16 04:06:54.274: E/dalvikvm(3034): VM aborting
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!