Commit graph

18 commits

Author SHA1 Message Date
Chih-Hung Hsieh
0c0d92887c Fix or suppress some google-runtime-int warnings.
Bug: 112478838
Test: build with WITH_TIDY=1
Change-Id: Ie3b15a85770b5806cddfd49a475aaf0553f9ec78
2018-08-10 15:14:26 -07:00
Narayan Kamath
0e4110e4c3 zipalign: Remove dependency on androidfw.
Use zip_archive directly. Note that this codepath is used only
when recompressing archives with zopfli during the alignment step.
It's unclear whether this is in use at all, but I verified that the
results are identical (note the usage of the "-z" flag in the test
below).

Test: make && out/host/linux-x86/bin/zipalign -v -f -z 8 \
        out/target/product/marlin/system/app/Email/Email.apk ./out.zip

Bug: 35246701
Change-Id: I641cdb6d409cc07974d49d42c9f9e6d4f905e472
2017-10-30 12:18:16 +00:00
Chih-Hung Hsieh
2a5bc9dfbf Use -Werror in build/make
* Remove unused local variables.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: Iced5bb903902f49d7cd5cf5f572906a512c75e18
2017-10-03 13:53:13 -07:00
Narayan Kamath
b46507ff9e zipalign: remove support for adding members from gzip sources.
This was vestigial code and never actually called anywhere.

Test: make
Bug: 35246701
Change-Id: I9297ac5fa030d369946857414155450635b65410
2017-02-16 10:53:09 +00:00
Yunlian Jiang
221c1c027a Fix an uninitialized value warning.
Warning from the static analyzer:

build/tools/zipalign/ZipFile.cpp:503:5: warning: Function call argument
is an uninitialized value
pEntry->setDataInfo(uncompressedLen, endPosn - startPosn, crc,

Specifically, it's referencing `crc`, which would be uninitialized if we
hit either of these two error cases, since we'd return `NO_ERROR`.

Note that the warning is still there, but that's only because the static
analyzer can't see the asserts. If we #undef NDEBUG in the file, then
the warning disappears.

Bug: none
Test: With NDEBUG undefined, the warning is gone.
Change-Id: Iaed66127746c38add2c842ab027f2e1982d0e2fd
2016-10-10 17:31:06 -07:00
Aurimas Liutikas
af1d741182 Fix 2 unused parameter warnings in zipalign.
ZipFile parameter was not used and therefore can be removed.

Bug: 26936282
Change-Id: Id2b6e693b40571b7e7486304a6effaedc1b3c940
2016-02-12 02:13:30 +00:00
Dan Willemsen
41bc424c32 Use explicitly sized types in zipalign/ziptime
getLongLE would return a 64-bit number with the upper 32-bits set when
decoding a 32-bit number with the top bit set. Per the zip file format,
it was only expected to return a 32-bit number. Use explicitly sized
types so that we use the proper sizes and don't do any implicit
extensions.

Change-Id: I5a4304dc99ce5f8f17284d4ca3094ae115207a1e
2015-11-04 23:52:52 +00:00
Dan Willemsen
b589ae4e26 Revert "Remove changing uids/timestamps from zip/jar files"
This reverts commit 3c2c064c87.

zipalign depends on libandroidfw, and some setups don't include frameworks/base.

Bug: 24201956
Change-Id: I48ee95808924f6b2221f0a49ab205c2565096b1f
2015-10-29 21:26:18 +00:00
Dan Willemsen
3c2c064c87 Remove changing uids/timestamps from zip/jar files
Pass -X to zip so that Unix UID/GID and extra timestamps aren't
saved into the zip files.

Add a new option to zipalign, -t, to replace all timestamps with static
timestamps (2008 Jan 1 00:00:00). Use this for all non-APK zip files.
APK zip timestamps are set based on the certificate date in SignApk.

Bug: 24201956
Change-Id: Ifb619fc499ba9d99fc624f2acd5f8de36d78ef8e
2015-10-29 11:57:16 -07:00
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
Mathias Agopian
f14d85d6fc libutils clean-up
Change-Id: I93a0fef582580282d62379ddba3ae2d50f3ea0c5
2013-05-07 16:31:04 -07:00
Colin Cross
0bf80735ec build: move Zip* from libandroidfw to libutils
ZipUtils is needed by build/tools, move it from libandroidfw
(frameworks/base) to libutils (frameworks/native).

Change-Id: I188247d058f1baa0ebd14282208d496c4ba061be
2012-03-22 18:47:23 -07:00
Mathias Agopian
6b0a355b37 frameworks/base refactoring: build fix
Change-Id: If9f1b8a6a9eafa9ea17a3b994941c5c369be2130
2012-02-17 19:41:13 -08:00
Steve Block
ca1df5a380 Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ieea4e4511e1a95caeea42cd0a0c1147ebf9c2f48
2012-01-08 11:03:18 +00:00
Steve Block
c0b74df335 Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I817c12b1e97bee598097d02c70d509f7ab70576a
2012-01-05 23:28:01 +00:00
Steve Block
15fab1aa8c Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I9281fd27af8c6ec29ebdca60b22f6c9d5ff8deed
2012-01-03 22:37:53 +00:00
Steve Block
2da72c6265 Rename LOGV(_IF) to ALOGV(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: Ie7704789e47b9553d02e3f6ed89c3ceab532119c
2011-10-25 18:14:48 +01:00
Mathias Agopian
3344b2e9b2 break dependency on utils/ZipEntry.h and utils/ZipFile.h 2009-06-05 14:55:48 -07:00