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