In Android, ZipAlign is used to align resources at 4 bytes boundaries to speed up resource loading:
Resource processing code in Android can effectively access resources when they are aligned at 4-byte boundaries by matching them with memory. But for resources that are not aligned (i.e. when zipalign is not running on apk), it should return to reading them explicitly, which is slower and consumes additional memory.
After starting the tool, you can check the alignment using the command.
zipalign -c -v 4 application.apk
This creates a report and indicates whether there are errors or not. In my case, these reports indicate no alignment error, but the first number that I assume is the position of the resources in the final APK seems to indicate that some resources are not aligned at 4 byte boundaries.
Here is the beginning of this report:
Verifying alignment of APP-signed-aligned.apk (4)... 50 META-INF/MANIFEST.MF (OK - compressed) 24245 META-INF/KEYS.SF (OK - compressed) 49830 META-INF/KEYS.DSA (OK - compressed) 50683 AndroidManifest.xml (OK - compressed) 53096 assets/Assets/DB_Normal.db (OK) 595425 assets/Assets/Common/DM/Structures.xml (OK - compressed)
What did I miss? Is the first number a resource position? For example, Structures.xml similar to 595425 , which is not a multiple of 4 bytes.
android
J_d
source share