Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the use of Android Zipalign

I was reading about zipalign in android. I am new to this concept. I search on google for the same but didn't find any appropriate answer.

Can anyone tell me what's the actual use of zipalign?

Is signed apk and zipalign is the same?

Thanks in advance!

like image 927
Harsh Shah Avatar asked Oct 22 '25 09:10

Harsh Shah


1 Answers

I had the same question and did not notice why it should be used the first time I checked the documentation. But here is the part from the doc (https://developer.android.com/studio/command-line/zipalign) explaining what zipalign does, especially saying why it should be used in the second sentence (to save RAM):

zipalign is a zip archive alignment tool that helps ensure that all uncompressed files in the archive are aligned relative to the start of the file. This lets the files be accessed directly via mmap(2) , removing the need to copy this data in RAM and reducing your app's memory usage.

The doc also says signing is a different step and zipalign must be done before if you use apksigner or after if you use jarsigner.

like image 99
baptx Avatar answered Oct 25 '25 00:10

baptx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!