platform_build/tools/zipalign
Alex Klyubin 2a10307455 Merge "zipalign supports -p also when checking alignment." am: 401f8b953f
am: b6587f9895

* commit 'b6587f9895e61751e9a85faa3ab7ace753dcf07e':
  zipalign supports -p also when checking alignment.

Change-Id: I11207ce34a3f2d3a5c55df4ac67c92c7032e5b68
2016-04-29 20:35:07 +00:00
..
Android.mk Enable -Werror on zipalign 2016-03-18 10:04:07 -07:00
README.txt Revert "Remove changing uids/timestamps from zip/jar files" 2015-10-29 21:26:18 +00:00
ZipAlign.cpp zipalign supports -p also when checking alignment. 2016-04-29 12:32:17 -07:00
ZipEntry.cpp Enable -Werror on zipalign 2016-03-18 10:04:07 -07:00
ZipEntry.h Merge "Fix compilation warning." 2016-03-17 22:55:45 +00:00
ZipFile.cpp Fix 2 unused parameter warnings in zipalign. 2016-02-12 02:13:30 +00:00
ZipFile.h Use explicitly sized types in zipalign/ziptime 2015-11-04 23:52:52 +00:00

zipalign -- zip archive alignment tool

usage: zipalign [-f] [-v] <align> infile.zip outfile.zip
       zipalign -c [-v] <align> infile.zip

  -c : check alignment only (does not modify file)
  -f : overwrite existing outfile.zip
  -p : page align stored shared object files
  -v : verbose output
  <align> is in bytes, e.g. "4" provides 32-bit alignment
  infile.zip is an existing Zip archive
  outfile.zip will be created


The purpose of zipalign is to ensure that all uncompressed data starts
with a particular alignment relative to the start of the file.  This
allows those portions to be accessed directly with mmap() even if they
contain binary data with alignment restrictions.

Some data needs to be word-aligned for easy access, others might benefit
from being page-aligned.  The adjustment is made by altering the size of
the "extra" field in the zip Local File Header sections.  Existing data
in the "extra" fields may be altered by this process.

Compressed data isn't very useful until it's uncompressed, so there's no
need to adjust its alignment.

Alterations to the archive, such as renaming or deleting entries, will
potentially disrupt the alignment of the modified entry and all later
entries.  Files added to an "aligned" archive will not be aligned.

By default, zipalign will not overwrite an existing output file.  With the
"-f" flag, an existing file will be overwritten.

You can use the "-c" flag to test whether a zip archive is properly aligned.

The "-p" flag aligns any file with a ".so" extension, and which is stored
uncompressed in the zip archive, to a 4096-byte page boundary.  This
facilitates directly loading shared libraries from inside a zip archive.