Commit graph

52 commits

Author SHA1 Message Date
Chih-Hung Hsieh
9b2bf2d55b Fix print format error.
Bug: 112478836
Test: build with WITH_TIDY=1
Change-Id: I0b9239be7c73cceb0b525c091a9b3a25add31204
Exempt-From-Owner-Approval: fix broken build on mac
2018-08-11 11:33:43 -07:00
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
887c645e02 zipalign: Fix build failure in static_sdk_tools.
Convert all dependencies to static deps.

Test: make -j50 static_sdk_tools BUILD_HOST_static=1
Bug: 35246701
Bug: 68804545

Change-Id: Ia46ac30e5c05226f1bfec82a84f05e4be945bf74
2017-11-06 11:12:08 -08: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
Dan Willemsen
c0a0f2dc1f Convert to Android.bp
Test: m atree fs_config fs_config_generate_test fs_config-unit-tests fs_get_stats zipalign
Test: cd out/host/linux-x86/nativetest64/fs_config-unit-tests ./fs_config-unit-tests
Change-Id: I3c5403a7f1cf221715eb52a41c640af9afcee175
2017-09-09 13:47:34 -07:00
Mathias Agopian
319524ba33 fallout of cleaning-up libutils includes
Test: run & compile
Bug: n/a
Change-Id: Ia213c25f166805a203d472761d024fa6b6efdc24
2017-03-03 12:37:34 -08: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
Mark Salyzyn
404fd5bc4a zipalign missing header
Remove assumptions about header side effects

Test: compile
Bug: 30465923
Change-Id: I117567b0f99814b9d9a955b39c56f43f7972cf62
2016-10-17 12:22:44 -07:00
Treehugger Robot
b37e81d3cd Merge "Fix a nullness warning." 2016-10-11 19:29:37 +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
Yunlian Jiang
4f1a91cbac Fix a nullness warning.
This silences a warning null pointer passed as an argument to a
'nonnull' parameter

BUG=None
Test: The warning is gone.

Change-Id: I10a17d4674bfb373d7fe8666863abd5f10a4d11f
2016-10-05 10:52:35 -07:00
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
Alex Klyubin
01d6b59dcf zipalign supports -p also when checking alignment.
This updates the usage banner of zipalign to state that the -p switch
is supported in check alignment mode.

Change-Id: I119026b0e09e5a2528646e88a9b58dbb79c0c17c
2016-04-29 12:32:17 -07:00
Ying Wang
2c6fbca557 Enable -Werror on zipalign
And fix the last warning to enable this flag.

Bug: 27695718
Change-Id: I70eb9c87530a9b982fbe83abea706908f0ce0356
2016-03-18 10:04:07 -07:00
Ying Wang
3fbc1c655c Merge "Fix compilation warning."
am: 5af0991

* commit '5af0991bfce1695818c76ef3db2c36cc609f4980':
  Fix compilation warning.
2016-03-17 22:55:45 +00:00
Ying Wang
0c38bc5762 Fix compilation warning.
Fix compilation warning:
" destination for this 'memcpy' call is a pointer to dynamic class
'CentralDirEntry'; vtable pointer will be overwritten"
by removing unnecessary virtual desctructor.

Bug: 27695718
Change-Id: Id3c451f82374f2232176115b7bc3291ac4275c00
2016-03-17 14:48:16 -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
Dan Willemsen
859ac34064 Add LOCAL_MODULE_HOST_OS
Instead of wrapping a host module definition in 'ifeq($(HOST_OS),...)'
in the Android.mk files, define which hosts are supported using
LOCAL_MODULE_HOST_OS.

A blank LOCAL_MODULE_HOST_OS means that linux and darwin are supported.
A non-empty LOCAL_MODULE_HOST_OS lists the supported HOST_OSs.

Change-Id: I1e342d1908cfa00aef2c39c145b4f5f81c373bc6
2015-09-03 16:40:51 -07:00
Dan Willemsen
7a5498568f Add _(darwin|linux|windows)
So that we can support building both linux and windows binaries at the
same time on a linux host. This replaces the ifeq($(HOST_OS),...) checks
in Android.mk files.

Bug: 23566667

Change-Id: I693e11984e36d55bb6f09fa0d49bc485463e16fb
2015-08-28 03:36:22 +00:00
Narayan Kamath
e0b8d19f31 Fix zipalign README file and usage strings.
Addresses comments from change 13e5965306.

Change-Id: I0a2c0048781858d3aa06347a77220547cfcdcebe
2015-02-27 14:17:17 +00:00
Dmitriy Ivanov
13e5965306 Store native libs aligned to PAGE_SIZE
- Add a new flag to zipalign (-p) that page aligns shared
  libraries (zip entries ending with ".so") in the archive.

- Add a new build variable LOCAL_PAGE_ALIGN_SHARED_LIBRARIES
  to turn on this behaviour in zipalign.

- Add a new LOCAL_JNI_SHARED_LIBRARIES_ZIP_OPTIONS to control
  zip behaviour.

Bug: 8076853
Bug: 19330157

Co-Authored-By: Simon Baldwin <simonb@google.com>
Co-Authored-By: Dimitry Ivanov <dimitry@google.com>
Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1
2015-02-26 12:31:40 +00:00
Yabin Cui
e9ae59b47f kill HAVE_LOCALTIME_R
Bug: 18361583
Change-Id: If76334a6e18893b65d9b526271620a460a75bf22
2014-11-13 11:51:37 -08:00
Ying Wang
5a5d443f15 am 8ac188ff: am 6dbbb159: Merge "Consistent use of USE_MINGW"
* commit '8ac188ff0e739ea75ea02166c54428245200f088':
  Consistent use of USE_MINGW
2014-08-08 03:26:07 +00:00
Ying Wang
594a10ae77 Consistent use of USE_MINGW
Change-Id: I05e212e5a99639d0196006b9c2ec35072c54f399
2014-08-07 20:08:04 -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
Ying Wang
8c431c157d Add liblog
Bug: 8580410
Change-Id: Id3c26ff084950f8cbfa87f4425747ee322de7624
2013-04-09 22:33:58 -07:00
Ying Wang
cd3190a9f5 Revert "Add liblog"
This reverts commit 8722580d90

Change-Id: Iafdbb7f540a53ddc9dc2e21c0afddb62c44c4af8
2013-04-10 05:32:21 +00:00
Ying Wang
8722580d90 Add liblog
Bug: 8580410
Change-Id: I45e17b786b8d221a071b5de2432bb1367e245fb4
2013-04-09 21:41:48 -07:00
Jean-Baptiste Queru
5ac65f8696 Merge "Fix reporting wrong error message for zipalign output file" 2012-08-23 14:52:41 -07:00
Andrew Hsieh
31ef1037bf Added BUILD_HOST_static to build statically linked executable/shared-lib
Statically linked executable/shared-lib (eg. SDK tools) are useful
in sandboxed environment.

In BUILD_HOST_static zipalign needs -lpthread indirectly:
zipalign->libutils.a->liblog.a->logd_write.c->pthread

Change-Id: I615f574e918c83ed1ab82db2453b69d0420cb59c
2012-08-21 14:40:16 +08:00
Jingwen Owen Ou
303213915d Fix reporting wrong error message for zipalign output file
The problem is due to using variable inFileName instead of outFileName for printing out error message for output file.

Change-Id: Ie53a21b077fea5e7cd106fe6884cea159d2629a2
2012-08-17 16:21:11 -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
9f763bec7b frameworks/base refactoring
add libandroidfw.so to the build

Change-Id: If84e8afd5056a5ac66c3c9e116d821a8a5a571dd
2012-02-20 22:38:41 -08:00
Mathias Agopian
6b0a355b37 frameworks/base refactoring: build fix
Change-Id: If9f1b8a6a9eafa9ea17a3b994941c5c369be2130
2012-02-17 19:41:13 -08:00
Glenn Kasten
1022e27642 Fix build warning
Change-Id: I1e3a76e4bdae5eec4f75c5d8eb9f533afab6d140
2012-01-12 07:30:27 -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
934443b275 Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: I02566a8d55d7f8845bcc11925b90b2dac4342e63
2012-01-04 20:07:45 +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
Raphael
925a3279b7 Make zipalign build for the Win SDK under Linux.
Change-Id: Ibd667437d6637fbc5b21147f57eb41e81cbd8577
2010-04-20 15:46:54 -07:00
Andy McFadden
95ed76bd3e Update usage and readme for zipalign.
Added the "-c" flag to the README, and added a short description of the
flag meanings to the usage output.  Threw in an AOSP copyright one-liner
for good measure.
2009-09-29 10:55:32 -07:00
Mathias Agopian
3344b2e9b2 break dependency on utils/ZipEntry.h and utils/ZipFile.h 2009-06-05 14:55:48 -07:00
Doug Zongker
3f2933b209 add check mode to zipalign
Add a -c flag to zipalign to do nothing but check the input zip file
for alignment (with or without verbosity).
2009-04-16 10:16:38 -07:00
The Android Open Source Project
88b607994a auto import from //depot/cupcake/@135843 2009-03-03 19:28:42 -08:00