能力值:
( LV2,RANK:10 )
|
-
-
26 楼
能支持多dex吗
|
能力值:
( LV2,RANK:10 )
|
-
-
27 楼
感谢分享
|
能力值:
( LV2,RANK:10 )
|
-
-
28 楼
感谢分享
|
能力值:
( LV3,RANK:30 )
|
-
-
29 楼
跟了一下,发现7.0以上,DexFile中多了两个参数,
6.0是 private static Object openDexFile(String sourceName, String outputName, int flags)
7.0以后是 private static Object openDexFile(String sourceName, String outputName, int flags,ClassLoader loader, DexPathList.Element[] elements)
|
能力值:
( LV3,RANK:30 )
|
-
-
30 楼
而且传参时,loader和elements传进去的应该是有实际意义的值,暂时还不知道怎么处理
|
能力值:
( LV2,RANK:10 )
|
-
-
31 楼
留名收藏
|
能力值:
( LV3,RANK:30 )
|
-
-
32 楼
楼主我在你代码的基础上添加了几行代码测试可以运行在7.0+机器上 if(sdk_int>22&&sdk_int<24)
{
mCookie = (*env)->GetFieldID(env, myDexFile, "mCookie", "Ljava/lang/Object;");
myOpenDexFile=(*env)->GetStaticMethodID(env, myDexFile, "openDexFile", "(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/Object;");
}
else if(sdk_int>=24){
//7.0+ openDexFile稍有不同
mCookie = (*env)->GetFieldID(env, myDexFile, "mCookie", "Ljava/lang/Object;");
myOpenDexFile=(*env)->GetStaticMethodID(env, myDexFile, "openDexFile", "(Ljava/lang/String;Ljava/lang/String;ILjava/lang/ClassLoader;[Ldalvik/system/DexPathList$Element;)Ljava/lang/Object;");
} if(sdk_int>22&&sdk_int<24)
{
art_MarCookie=(*env)->CallStaticObjectMethod(env, myDexFile, myOpenDexFile, inPath,0,0);
LOGI("----MarCookie:%p",art_MarCookie);
}else if(sdk_int>=24){
//7.0+此处需要5个参数
jclass ApplicationClass = (*env)->GetObjectClass(env,new_ctx);
jmethodID getClassLoader = (*env)->GetMethodID(env,ApplicationClass, "getClassLoader", "()Ljava/lang/ClassLoader;");
jobject classLoader = (*env)->CallObjectMethod(env,new_ctx, getClassLoader);
art_MarCookie=(*env)->CallStaticObjectMethod(env, myDexFile, myOpenDexFile, inPath,0,0,classLoader,0);
} new_ctx是attachBaseContext上的context
|
能力值:
( LV5,RANK:70 )
|
-
-
33 楼
谢谢分享,下载研究一番
|
能力值:
( LV2,RANK:10 )
|
-
-
34 楼
谢谢分享mark下
|
能力值:
( LV2,RANK:10 )
|
-
-
35 楼
谢谢分享
|
能力值:
( LV2,RANK:10 )
|
-
-
36 楼
mark
|
能力值:
( LV9,RANK:160 )
|
-
-
37 楼
赞赞赞
|
能力值:
( LV9,RANK:160 )
|
-
-
38 楼
赞赞赞
|
能力值:
( LV2,RANK:10 )
|
-
-
39 楼
阿里就是天真
|
能力值:
( LV2,RANK:10 )
|
-
-
40 楼
发现,跑步起来
|
能力值:
( LV3,RANK:30 )
|
-
-
41 楼
编译成功,启动后闪退出错了,求解(dex是否替换成功?) 04-09 09:53:58.419: I/info(4487): compare: i=0 item=0x1e100049 04-09 09:53:58.419: I/info(4487): replace: find same replace 04-09 09:53:58.469: D/dalvikvm(4487): JIT code cache reset in 0 ms (0 bytes 2/0) 04-09 09:53:58.469: D/dalvikvm(4487): GC_FOR_ALLOC freed 293K, 3% free 17423K/17940K, paused 13ms, total 13ms 04-09 09:53:58.489: I/dalvikvm-heap(4487): Grow heap (frag case) to 26.603MB for 9830416-byte allocation 04-09 09:53:58.499: D/dalvikvm(4487): GC_FOR_ALLOC freed 1K, 2% free 27022K/27544K, paused 11ms, total 11ms 04-09 09:53:58.549: D/AndroidRuntime(4487): Shutting down VM 04-09 09:53:58.549: W/dalvikvm(4487): threadid=1: thread exiting with uncaught exception (group=0x41fadba8) 04-09 09:53:58.559: E/AndroidRuntime(4487): FATAL EXCEPTION: main 04-09 09:53:58.559: E/AndroidRuntime(4487): Process: com.example.unpack, PID: 4487 04-09 09:53:58.559: E/AndroidRuntime(4487): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.unpack/com.ali.tg.testapp.MainActivity}: java.lang.NullPointerException
|
能力值:
( LV3,RANK:30 )
|
-
-
42 楼
需要用样本的资源替换掉工程的资源,ok!
|
能力值:
( LV3,RANK:30 )
|
-
-
43 楼
最近一直在学习dex加固的原理,看到这个复原一代壳真是太感谢大神了。。。 成功运行了出来,学习加固思路去了
|
能力值:
( LV2,RANK:10 )
|
-
-
44 楼
66666666
|
|
|