Loading tools/zipalign/README.txt +5 −0 Original line number Original line Diff line number Diff line Loading @@ -5,6 +5,7 @@ usage: zipalign [-f] [-v] <align> infile.zip outfile.zip -c : check alignment only (does not modify file) -c : check alignment only (does not modify file) -f : overwrite existing outfile.zip -f : overwrite existing outfile.zip -p : page align stored shared object files -v : verbose output -v : verbose output <align> is in bytes, e.g. "4" provides 32-bit alignment <align> is in bytes, e.g. "4" provides 32-bit alignment infile.zip is an existing Zip archive infile.zip is an existing Zip archive Loading Loading @@ -33,3 +34,7 @@ By default, zipalign will not overwrite an existing output file. With the You can use the "-c" flag to test whether a zip archive is properly aligned. 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. tools/zipalign/ZipAlign.cpp +4 −4 Original line number Original line Diff line number Diff line Loading @@ -33,21 +33,21 @@ void usage(void) fprintf(stderr, "Copyright (C) 2009 The Android Open Source Project\n\n"); fprintf(stderr, "Copyright (C) 2009 The Android Open Source Project\n\n"); fprintf(stderr, fprintf(stderr, "Usage: zipalign [-f] [-p] [-v] [-z] <align> infile.zip outfile.zip\n" "Usage: zipalign [-f] [-p] [-v] [-z] <align> infile.zip outfile.zip\n" " zipalign -c [-v] <align> infile.zip [list of files]\n\n" ); " zipalign -c [-v] <align> infile.zip\n\n" ); fprintf(stderr, fprintf(stderr, " <align>: alignment in bytes, e.g. '4' provides 32-bit alignment\n"); " <align>: alignment in bytes, e.g. '4' provides 32-bit alignment\n"); fprintf(stderr, " -c: check alignment only (does not modify file)\n"); fprintf(stderr, " -c: check alignment only (does not modify file)\n"); fprintf(stderr, " -f: overwrite existing outfile.zip\n"); fprintf(stderr, " -f: overwrite existing outfile.zip\n"); fprintf(stderr, " -p: page align stored shared object: files\n"); fprintf(stderr, " -p: page align stored shared object files\n"); fprintf(stderr, " -v: verbose output\n"); fprintf(stderr, " -v: verbose output\n"); fprintf(stderr, " -z: recompress using Zopfli\n"); fprintf(stderr, " -z: recompress using Zopfli\n"); } } static const int kPageAlignment = 4096; static int getAlignment(bool pageAlignSharedLibs, int defaultAlignment, static int getAlignment(bool pageAlignSharedLibs, int defaultAlignment, ZipEntry* pEntry) { ZipEntry* pEntry) { static const int kPageAlignment = 4096; if (!pageAlignSharedLibs) { if (!pageAlignSharedLibs) { return defaultAlignment; return defaultAlignment; } } Loading Loading
tools/zipalign/README.txt +5 −0 Original line number Original line Diff line number Diff line Loading @@ -5,6 +5,7 @@ usage: zipalign [-f] [-v] <align> infile.zip outfile.zip -c : check alignment only (does not modify file) -c : check alignment only (does not modify file) -f : overwrite existing outfile.zip -f : overwrite existing outfile.zip -p : page align stored shared object files -v : verbose output -v : verbose output <align> is in bytes, e.g. "4" provides 32-bit alignment <align> is in bytes, e.g. "4" provides 32-bit alignment infile.zip is an existing Zip archive infile.zip is an existing Zip archive Loading Loading @@ -33,3 +34,7 @@ By default, zipalign will not overwrite an existing output file. With the You can use the "-c" flag to test whether a zip archive is properly aligned. 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.
tools/zipalign/ZipAlign.cpp +4 −4 Original line number Original line Diff line number Diff line Loading @@ -33,21 +33,21 @@ void usage(void) fprintf(stderr, "Copyright (C) 2009 The Android Open Source Project\n\n"); fprintf(stderr, "Copyright (C) 2009 The Android Open Source Project\n\n"); fprintf(stderr, fprintf(stderr, "Usage: zipalign [-f] [-p] [-v] [-z] <align> infile.zip outfile.zip\n" "Usage: zipalign [-f] [-p] [-v] [-z] <align> infile.zip outfile.zip\n" " zipalign -c [-v] <align> infile.zip [list of files]\n\n" ); " zipalign -c [-v] <align> infile.zip\n\n" ); fprintf(stderr, fprintf(stderr, " <align>: alignment in bytes, e.g. '4' provides 32-bit alignment\n"); " <align>: alignment in bytes, e.g. '4' provides 32-bit alignment\n"); fprintf(stderr, " -c: check alignment only (does not modify file)\n"); fprintf(stderr, " -c: check alignment only (does not modify file)\n"); fprintf(stderr, " -f: overwrite existing outfile.zip\n"); fprintf(stderr, " -f: overwrite existing outfile.zip\n"); fprintf(stderr, " -p: page align stored shared object: files\n"); fprintf(stderr, " -p: page align stored shared object files\n"); fprintf(stderr, " -v: verbose output\n"); fprintf(stderr, " -v: verbose output\n"); fprintf(stderr, " -z: recompress using Zopfli\n"); fprintf(stderr, " -z: recompress using Zopfli\n"); } } static const int kPageAlignment = 4096; static int getAlignment(bool pageAlignSharedLibs, int defaultAlignment, static int getAlignment(bool pageAlignSharedLibs, int defaultAlignment, ZipEntry* pEntry) { ZipEntry* pEntry) { static const int kPageAlignment = 4096; if (!pageAlignSharedLibs) { if (!pageAlignSharedLibs) { return defaultAlignment; return defaultAlignment; } } Loading