godlikewangjun / dexknife-wj

apk加固插件 带签名校验、dex加密、资源混淆
403 stars 111 forks source link

部分手机会出现dex decrypt failure,闪退 #8

Open smalljames opened 7 years ago

smalljames commented 7 years ago

在某些手机启动时,解压classes2.dex时,会出现dex decrypt failure。log如下: W/System.err: net.lingala.zip4j.exception.a: net.lingala.zip4j.exception.a: java.io.EOFException: Unexpected end of ZLIB input stream W/System.err: at net.lingala.zip4j.unzip.a.a(SourceFile:163) W/System.err: at net.lingala.zip4j.unzip.a.a(SourceFile:117) W/System.err: at net.lingala.zip4j.model.f.a(SourceFile:292) W/System.err: at net.lingala.zip4j.core.b.a(SourceFile:634) W/System.err: at net.lingala.zip4j.core.b.a(SourceFile:587) W/System.err: at net.lingala.zip4j.core.b.a(SourceFile:566) W/System.err: at com.qianfandu.utils.ApkToolPlus.a(SourceFile:80) W/System.err: at com.qianfandu.utils.a.a(SourceFile:328) W/System.err: at com.qianfandu.utils.a.a(SourceFile:251) W/System.err: at com.qianfandu.utils.a.a(SourceFile:126) W/System.err: at com.qianfandu.ProxyApplication.attachBaseContext(SourceFile:56) W/System.err: at android.app.Application.attach(Application.java:194) W/System.err: at android.app.Instrumentation.newApplication(Instrumentation.java:992) W/System.err: at android.app.Instrumentation.newApplication(Instrumentation.java:976) W/System.err: at android.app.LoadedApk.makeApplication(LoadedApk.java:532) W/System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4586) W/System.err: at android.app.ActivityThread.access$1800(ActivityThread.java:139) W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102) W/System.err: at android.os.Looper.loop(Looper.java:136) W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5314) W/System.err: at java.lang.reflect.Method.invokeNative(Native Method) W/System.err: at java.lang.reflect.Method.invoke(Method.java:515) W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864) W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680) W/System.err: at dalvik.system.NativeStart.main(Native Method) W/System.err: Caused by: net.lingala.zip4j.exception.a: java.io.EOFException: Unexpected end of ZLIB input stream W/System.err: at net.lingala.zip4j.unzip.b.a(SourceFile:96) W/System.err: at net.lingala.zip4j.unzip.a.a(SourceFile:160) W/System.err: ... 25 more W/System.err: Caused by: java.io.EOFException: Unexpected end of ZLIB input stream W/System.err: at net.lingala.zip4j.io.b.d(SourceFile:114) W/System.err: at net.lingala.zip4j.io.b.read(SourceFile:81) W/System.err: at net.lingala.zip4j.io.d.read(SourceFile:45) W/System.err: at net.lingala.zip4j.io.d.read(SourceFile:41) W/System.err: at net.lingala.zip4j.unzip.b.a(SourceFile:81) W/System.err: ... 26 more E/ApkProtect: dex decrypt failure!!!

代码定位错误位置: qq 20170705090023

godlikewangjun commented 7 years ago

这个是解压太慢的原因,之后会改,你可以先改加密方式

smalljames commented 7 years ago

有什么办法知道它解压结束吗?

godlikewangjun commented 7 years ago

zip4j 有进度监听 你搜搜

smalljames commented 7 years ago

进一步定位,是这wrieTemp抛出了异常 writeTemp(inputStream, new FileOutputStream(file1));

godlikewangjun commented 7 years ago

下个版本会彻底的解决这个问题,目前是加解密替换方式还存在问题。你有好的方式吗?

smalljames commented 7 years ago

把加解密都放在 jni里做,但不知道兼容性是否好,现在有部分手机是64位的

smalljames commented 7 years ago

我找到一个jni加解密的工程,但对jni不太熟悉,你有邮箱吗?我发给你,参考一下

godlikewangjun commented 7 years ago

是通用的加密算法吗? 需要java和c都有的。1206792489@qq.com

smalljames commented 7 years ago

已发到你邮箱里了,请查收

godlikewangjun commented 7 years ago

好的

smalljames commented 7 years ago

有参考价值吗?

godlikewangjun commented 7 years ago

体积会增大不少

smalljames commented 7 years ago

体积跟之前一样大了吗