machinamentum / PocketTool

36 stars 67 forks source link

Minecraft APK generated by PocketTool corrupt #4

Closed zhuowei closed 11 years ago

zhuowei commented 11 years ago

What is this?

This was /sdcard/Android/data/com.joshuahuelsman.pockettool/minecraft.apk . This causes the .zip to not unzip properly and PocketTool to commit suicide via force close.

I;m using a modded APK; I tried deleting the folder, and deleting the demo edition, leaving the full edition, to no avail. I thought I reinstalled the apk when I started the issue, but it turns out that it was failing due to certificates.

With a fresh .apk, Minecraft-cs.apk is still like this, but not Minecraft.apk.

machinamentum commented 11 years ago

minecraft.apk is an exact image of the apk that existed in your device's memory when PocketTool was started up for the first time. You should always start PocketTool the first time with a fresh apk. Modded apks cause alot of issues with Android's implementation of Zip. PocketTool uses this local version of the apk to unzip all the resources it needs such as the originals folder, which is then copied to create the temp folder. Due to zip errors, when zipping the temp directory into minecraft-c.apk, it becomes slightly corrupt. Then in the signing process, minecraft-cs.apk becomes a corrupt Zip file, however, Android still sees it as a valid apk and will install it without issues (as long as the original minecraft is uninstalled, due to different signatures).

zhuowei commented 11 years ago

I noticed that immediately after I posted the issue, so I tested with a fresh .apk and it worked again. The recent PR should create unzippable .apks again.

In the future, modded APKs should contain, say, a modded.txt file or something so that PocketTool can warn users if this happens.