1 zipalign -- zip archive alignment tool 2 3 usage: zipalign [-f] [-v] <align> infile.zip outfile.zip 4 zipalign -c [-v] <align> infile.zip 5 6 -c : check alignment only (does not modify file) 7 -f : overwrite existing outfile.zip 8 -v : verbose output 9 <align> is in bytes, e.g. "4" provides 32-bit alignment 10 infile.zip is an existing Zip archive 11 outfile.zip will be created 12 13 14 The purpose of zipalign is to ensure that all uncompressed data starts 15 with a particular alignment relative to the start of the file. This 16 allows those portions to be accessed directly with mmap() even if they 17 contain binary data with alignment restrictions. 18 19 Some data needs to be word-aligned for easy access, others might benefit 20 from being page-aligned. The adjustment is made by altering the size of 21 the "extra" field in the zip Local File Header sections. Existing data 22 in the "extra" fields may be altered by this process. 23 24 Compressed data isn't very useful until it's uncompressed, so there's no 25 need to adjust its alignment. 26 27 Alterations to the archive, such as renaming or deleting entries, will 28 potentially disrupt the alignment of the modified entry and all later 29 entries. Files added to an "aligned" archive will not be aligned. 30 31 By default, zipalign will not overwrite an existing output file. With the 32 "-f" flag, an existing file will be overwritten. 33 34 You can use the "-c" flag to test whether a zip archive is properly aligned. 35 36