platform_build/tools/zipalign
Raph Levien 093d04c631 Add Zopfli-recompress option to zipalign
Zopfli provides compression roughly 5% better than zlib, while remaining
completely compatible with zlib decoders. This patch adds a "-z" option
to zipalign, recompressing all compressed files within the zip archive.

Change-Id: If177ca4b82ec701b7446861b2cfe08c6bd403813
2014-07-07 16:03:49 -07:00
..
Android.mk Add Zopfli-recompress option to zipalign 2014-07-07 16:03:49 -07:00
README.txt Update usage and readme for zipalign. 2009-09-29 10:55:32 -07:00
ZipAlign.cpp Add Zopfli-recompress option to zipalign 2014-07-07 16:03:49 -07:00
ZipEntry.cpp Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE 2012-01-05 23:28:01 +00:00
ZipEntry.h break dependency on utils/ZipEntry.h and utils/ZipFile.h 2009-06-05 14:55:48 -07:00
ZipFile.cpp Add Zopfli-recompress option to zipalign 2014-07-07 16:03:49 -07:00
ZipFile.h Add Zopfli-recompress option to zipalign 2014-07-07 16:03:49 -07:00

README.txt

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
  -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.