• Home
Name Date Size #Lines LOC

..--

include/03-May-2024-509

tests/03-May-2024-5435

Android.bpD03-May-20241.5 KiB8073

OWNERSD03-May-202467 32

README.txtD03-May-20241.7 KiB4129

ZipAlign.cppD03-May-20245.7 KiB189119

ZipAlignMain.cppD03-May-20243.4 KiB13790

ZipEntry.cppD03-May-202421 KiB701456

ZipEntry.hD03-May-20249.9 KiB348180

ZipFile.cppD03-May-202440.1 KiB1,452886

ZipFile.hD03-May-20248.3 KiB266112

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