java.util.zip.ZipException: File too short to be a zip file: 0
MrFuFuFu opened this issue · 13 comments
When I was run 1.apk, throw this error, but the app not crash, It seem run success. and The repalce patch was also right. So this error has any problem?
09-16 05:07:05.607: E/PatchManager(20395): addPatch
09-16 05:07:05.607: E/PatchManager(20395): java.util.zip.ZipException: File too short to be a zip file: 0
09-16 05:07:05.607: E/PatchManager(20395): at java.util.zip.ZipFile.readCentralDir(ZipFile.java:376)
09-16 05:07:05.607: E/PatchManager(20395): at java.util.zip.ZipFile.<init>(ZipFile.java:163)
09-16 05:07:05.607: E/PatchManager(20395): at java.util.jar.JarFile.<init>(JarFile.java:199)
09-16 05:07:05.607: E/PatchManager(20395): at java.util.jar.JarFile.<init>(JarFile.java:182)
09-16 05:07:05.607: E/PatchManager(20395): at java.util.jar.JarFile.<init>(JarFile.java:168)
09-16 05:07:05.607: E/PatchManager(20395): at com.alipay.euler.andfix.patch.Patch.init(Patch.java:75)
09-16 05:07:05.607: E/PatchManager(20395): at com.alipay.euler.andfix.patch.Patch.<init>(Patch.java:67)
09-16 05:07:05.607: E/PatchManager(20395): at com.alipay.euler.andfix.patch.PatchManager.addPatch(PatchManager.java:125)
09-16 05:07:05.607: E/PatchManager(20395): at com.alipay.euler.andfix.patch.PatchManager.initPatchs(PatchManager.java:111)
09-16 05:07:05.607: E/PatchManager(20395): at com.alipay.euler.andfix.patch.PatchManager.init(PatchManager.java:104)
09-16 05:07:05.607: E/PatchManager(20395): at com.euler.andfix.MainApplication.onCreate(MainApplication.java:48)
09-16 05:07:05.607: E/PatchManager(20395): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
09-16 05:07:05.607: E/PatchManager(20395): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
09-16 05:07:05.607: E/PatchManager(20395): at android.app.ActivityThread.access$1500(ActivityThread.java:151)
09-16 05:07:05.607: E/PatchManager(20395): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
09-16 05:07:05.607: E/PatchManager(20395): at android.os.Handler.dispatchMessage(Handler.java:102)
09-16 05:07:05.607: E/PatchManager(20395): at android.os.Looper.loop(Looper.java:135)
09-16 05:07:05.607: E/PatchManager(20395): at android.app.ActivityThread.main(ActivityThread.java:5254)
09-16 05:07:05.607: E/PatchManager(20395): at java.lang.reflect.Method.invoke(Native Method)
09-16 05:07:05.607: E/PatchManager(20395): at java.lang.reflect.Method.invoke(Method.java:372)
09-16 05:07:05.607: E/PatchManager(20395): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
09-16 05:07:05.607: E/PatchManager(20395): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
09-16 05:07:05.607: D/euler(20395): inited.
09-16 05:07:05.609: D/euler(20395): apatch loaded.
09-16 05:07:05.634: D/SecurityChecker(20395): mDebuggable = true
09-16 05:07:05.768: D/AndFix(20395): modify com.euler.andfix.MainActivity.TAG flag:
09-16 05:07:05.768: D/AndFix(20395): setFieldFlag_m: 1
09-16 05:07:05.768: D/AndFix(20395): replace_m: -1290452868 , -1290452868
09-16 05:07:05.768: D/AndFix(20395): modify com.euler.andfix.MainActivity_CF.TAG flag:
09-16 05:07:05.768: D/AndFix(20395): setFieldFlag_m: 1
09-16 05:07:05.768: D/euler(20395): apatch:/storage/emulated/0/out.apatch added.
09-16 05:07:05.792: D/qq(20395): good
09-16 05:07:05.792: I/euler(20395): fix succes
09-16 05:07:05.792: E/euler(20395): b
09-16 05:07:05.792: E/euler(20395): s1
09-16 05:07:05.792: E/euler(20395): 11==a
09-16 05:07:05.792: I/euler(20395): fix success
09-16 05:07:05.792: I/euler(20395): fix
09-16 05:07:05.792: E/euler(20395): 0
09-16 05:07:05.794: E/euler(20395): 10
1.run 1.apk
2.patch file size?
hi supern,帮忙看一下#10
@supern sorry. describe wrong, I was run 1.apk, not 2.apk. ^ ^
out.apatch file size is 2KB
是不是patch包不对啊,我这打出来的是3k
@supern jest jakis post�ep z ta poprawk�a? :P c'mon guys, not everyone read/write in your native language ^^
@andrzejsliwa sorry ^_^
我也碰到了类似的问题
java.util.zip.ZipException: File too short to be a zip file: 0
at java.util.zip.ZipFile.readCentralDir(ZipFile.java:355)
at java.util.zip.ZipFile.(ZipFile.java:151)
at java.util.zip.ZipFile.(ZipFile.java:115)
at java.util.jar.JarFile.(JarFile.java:166)
at java.util.jar.JarFile.(JarFile.java:152)
at com.alipay.euler.andfix.patch.Patch.init(Patch.java:75)
at com.alipay.euler.andfix.patch.Patch.(Patch.java:67)
at com.alipay.euler.andfix.patch.PatchManager.addPatch(PatchManager.java:125)
at com.alipay.euler.andfix.patch.PatchManager.initPatchs(PatchManager.java:111)
at com.alipay.euler.andfix.patch.PatchManager.init(PatchManager.java:104)
at com.pp.assistant.PPApplication.initCloudFix(PPApplication.java:213)
at com.pp.assistant.PPApplication.initApplication(PPApplication.java:208)
at com.lib.common.PPBaseApplication.onCreate(PPBaseApplication.java:97)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4394)
at android.app.ActivityThread.access$1500(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1273)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5072)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)
肯定是有读写sdcard权限的,patch包大小为 150Kb
加上读取SDCard权限,就不报这个错误了
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
I have the same problem.What is wrong?
java.util.zip.ZipException: File too short to be a zip file: 9
at java.util.zip.ZipFile.readCentralDir(ZipFile.java:355)
at java.util.zip.ZipFile.(ZipFile.java:151)
at java.util.zip.ZipFile.(ZipFile.java:115)
at java.util.jar.JarFile.(JarFile.java:166)
at java.util.jar.JarFile.(JarFile.java:152)
at com.alipay.euler.andfix.patch.Patch.init(Patch.java:75)
at com.alipay.euler.andfix.patch.Patch.(Patch.java:67)
at com.alipay.euler.andfix.patch.PatchManager.addPatch(PatchManager.java:126)
at com.alipay.euler.andfix.patch.PatchManager.initPatchs(PatchManager.java:112)
at com.alipay.euler.andfix.patch.PatchManager.init(PatchManager.java:105)
at com.gaokaozhiyuan.IpinApplication.initAndFix(IpinApplication.java:102)
at com.gaokaozhiyuan.IpinApplication.initModule(IpinApplication.java:93)
at com.gaokaozhiyuan.IpinApplication.onCreate(IpinApplication.java:57)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4440)
at android.app.ActivityThread.access$1500(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1272)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5113)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)
请问大家都怎么解决的?我也出现这个问题,作者的demo没问题,但是我自己的不行。权限和代码都看过了,都一样的。怀疑可能是签名的方式问题。作者的demo不用选择v1 v2方式,可以直接打包;我的项目需要选择v1 v2方式,我选择的是v1。有人说是apatch太小,作者demo生成的是2kb,我自己的是4kb,没理由我的大却提示此错误。还请各位指教,谢谢!
同样的错误。请问各位都是怎么解决的?