Reducing APK size by re-zipping its content

前端 未结 2 1751
轻奢々
轻奢々 2021-02-20 17:49

I have a pretty large apk file, and I\'m trying to reduce its size. Already used all the common techniques, such as Proguard and image compression. Still, the apk is quite larg

2条回答
  •  攒了一身酷
    2021-02-20 18:30

    Assuming you are forcing 7zip to use its zip compatible mode (-tzip) then this is an entirely valid operation (though as @CommonsWare notes, there is a tiny possibility that you are opening yourself up to some buggy implementations of the zip unpacking routine on some phones).

    The reason that you are able to get a size reduction are twofold:

    • 7zip has a better compressor, that uses more CPU on the compression to come up with a perfectly compatible but more compressed representation
    • aapt which is traditionally used to do the compression/packaging of the Android file has a long list of filetypes (such as jpg, png, mp3) that it simply does not try to compress, on the grounds that these filetypes already have internal compression. Even so, there's often a few percent gain to be had by compressing them inside the apk file

提交回复
热议问题