Commit graph

29 commits

Author SHA1 Message Date
Adam Lesinski
591fd3953d Add deflate compression to ZipWriter
Use zlib to deflate compress data into the zip file.

Change-Id: If094b926a67e199be976c3190781cd0101dd66e1
2015-10-20 12:40:33 -07:00
Adam Lesinski
ad4ad8cfc8 Implement ZipWriter for quickly writing ZipFiles.
The ZipWriter implementation exposes a stateful interface that allows
bytes of data to be streamed in as they arrive. ZipEntries can be
compressed and/or aligned on a 32-bit boundary for mmapping at runtime.

Change-Id: I43ac9e661aa5022f00d9e12b247c4314d61c441c
2015-10-15 16:27:44 -07:00
Dan Willemsen
87a419c8b1 Remove USE_MINGW/CYGWIN; Whitelist windows modules
CYGWIN is not supported, USE_MINGW and HOST_OS==windows are being
replaced with LOCAL_..._windows variables.

Bug: 23566667
Change-Id: I3e4a1e4097dc994cf5abdce6939e83a91758fd75
2015-09-02 17:10:35 -07:00
Evgenii Stepanov
953314fc21 Fix ODR issues in ART.
Linking against both libziparchive-host and libz-host results in
libz loaded twice (because it is also linked statically in
libziparchive).

Change-Id: Ib34eef60200a702c2d7fbca3589b324992e78eab
2015-06-29 16:27:44 -07:00
Evgeniy Stepanov
a8cc2081b4 Revert "Fix ODR issues in ART."
Fails build on Mac.

This reverts commit 2148a1243e.

Change-Id: Ib4f0ba0b0a42500f20b7d73ca91363477fe3d093
2015-05-30 00:47:30 +00:00
Evgenii Stepanov
2148a1243e Fix ODR issues in ART.
Linking against both libziparchive-host and libz-host results in
libz loaded twice (because it is also linked statically in
libziparchive).

bug: 21365909

Change-Id: Ie924e0b38e4c0811daff06e7c0bfed048e7ca82f
2015-05-28 10:53:23 -07:00
Dan Albert
1ae0764e01 Prevent unaligned read in libziparchive.
Change-Id: I4afc3729a1b2c06a6621cb8c9742fc94b5a665f5
2015-04-09 17:00:14 -07:00
Elliott Hughes
bcc2b5f44a Remove LOCAL_ADDITIONAL_DEPENDENCIES in cases where it's not needed.
Change-Id: I720b8ef1050da45a7833adef8219b6acb2cf3a38
2015-04-02 14:31:07 -07:00
Dmitriy Ivanov
f94e159007 Reapply -Wold-style-cast
Added pragmas to disable checks for the method
 using libz.h macros.

Change-Id: I25aa1adf09f3ecff61d8fea6306b24b37990ab46
2015-03-06 13:57:43 -08:00
Dmitriy Ivanov
34d1b0fa63 Fix build: Remove -Wold-style-cast
libz.h has macros using old-style-cast.

Change-Id: I48f7d85805c7c34e1453c863da3c9e734a57d479
2015-03-06 13:07:52 -08:00
Dmitriy Ivanov
f4cb8e2ac2 Cleanup old-style-cast warnings
Change-Id: I6e17fd993557cbf78ade787f112794358aee39c8
2015-03-06 10:50:56 -08:00
Narayan Kamath
3f5bba537e Merge "Reject zip archives whose entry names are not valid UTF-8." 2014-12-08 13:08:34 +00:00
Narayan Kamath
044bc8ee89 Reject zip archives whose entry names are not valid UTF-8.
bug: 18584205
Change-Id: Iaf3e8211dab6a1e3923f7fee6ea7fc693972dba3
2014-12-08 12:25:05 +00:00
Trevor Drake
f73237346e Clean up libziparchive Android.mk
Removed LOCAL_C_INCLUDES which are no longer necessary as zlib
now uses the LOCAL_EXPORT_C_INCLUDE_DIRS mechanism.

Removed a couple of redundant LOCAL_MODULE entries

Tested compiling some of the projects that make use of libziparchive
and libziparchive-host using a clean out dir with aosp_flounder-userdebug
aosp_arm-eng targets

make -j3 libziparchive libandroidfw libartd libart libjavacore libjavacoretests aapt

Change-Id: I2988f1b3a62d1df2b5eada4ad39a9246ac1184fb
2014-12-06 00:07:05 +00:00
Dan Albert
5fc8f683e6 am 7a92d20e: Merge "Clean up some test makefiles."
* commit '7a92d20ec845c07472eaea7cf14fd0e69df836ef':
  Clean up some test makefiles.
2014-11-05 02:27:42 +00:00
Dan Albert
27d166cb3a Clean up some test makefiles.
Needed for building with libc++ as the default STL.

Bug: 15193147
Change-Id: I8b462bd288fbea7e0ab182f85ffcbf438afb6aa4
2014-11-04 17:19:55 -08:00
Ian Rogers
8dac3559dd am b968d5c8: Merge "Add shared library version of libziparchive."
* commit 'b968d5c8468c9b0707f88f773fae16074e9018cf':
  Add shared library version of libziparchive.
2014-10-30 18:08:17 +00:00
Ian Rogers
40ac96c72c Add shared library version of libziparchive.
Change-Id: I9abded3bbff0e7976b1849c73e6978dd10ca84cd
2014-10-30 09:53:38 -07:00
Xavier Ducrohet
0c7ad123ca am cd1da4e0: Fix toolchain issue for windows build of libziparchive.
* commit 'cd1da4e04f0eb71a92a586c66acd0e34115608e1':
  Fix toolchain issue for windows build of libziparchive.
2014-10-16 16:55:08 +00:00
Xavier Ducrohet
cd1da4e04f Fix toolchain issue for windows build of libziparchive.
With mingw 4.8, the new default packed behavior is broken and makes
zip archive fails due to unexpected misalignment in
CentralDirectoryRecord.

This patch uses -mno-ms-bitfields to revert to the old packed
behavior.

Change-Id: Ic977c841e330e19451db1d31ddb22e570a525062
2014-10-16 07:49:16 +00:00
Piotr Jastrzebski
8e08536108 Fix win_sdk build by not using vector
Change-Id: I4e9ee4286ea29e1f5f2ee477525e79bfa16ad9a0
2014-08-18 14:04:56 +01:00
Piotr Jastrzebski
ecccc5ad93 Replace char* with ZipEntryName in ziparchive API.
It's important because entry names can be encoded in UTF-8 and can have \0
character in the middle.
Use vector instead of char* for prefix in IterationHandle.

Bug: 16162465
Change-Id: Ie34c8d7c6231cc258530c22bdde5542895213649
2014-08-15 12:39:45 +01:00
Tim Murray
06fce9db05 Update makefiles for host clang.
bug 16172793

Change-Id: If7484c5dbcccce7d925bec97bff0a3e4c30e9434
2014-07-24 12:18:22 -07:00
Ian Rogers
5af80aa119 Enable host multilib for ART testing.
Change-Id: Ic3ae5122eba13565fb5a4cb1bd0e7e465fb2140c
2014-06-17 01:50:25 -07:00
Mark Salyzyn
51d562d399 libziparchive: Turn on -Werror
Change-Id: I98a93273b9e1bac0324dd210f6a8493ba780e878
2014-05-07 16:56:21 -07:00
Narayan Kamath
95986aae91 Fix a sporadic build breakage.
The issue here is that the makefile sets LOCAL_LDFLAGS
and asks for -llog without declaring a dependency on it.
This will cause build breakages if liblog hasn't already
been built yet.

Change-Id: Ia38761cda44a38b6c2a88902d6108cbe64a328ce
2014-01-03 15:40:37 +00:00
Narayan Kamath
eaf988532b Use FileMap from libcutil instead of rolling our own.
Adds windows support as a side effect.

Change-Id: I912c1f980f284d01d4f3936291999646ddf6250a
2013-12-11 15:17:06 +00:00
Narayan Kamath
58aaf46e4d Add unit tests for libziparchive.
- Add a build rule for host tests
- Add basic tests for Find / Iterate and Extract
  for both deflated & stored entries.
- Fix an off by one error that the test uncovered.

Change-Id: If72009b1ea9791d5a265829f05c32ffe1c2752c4
2013-12-10 16:48:50 +00:00
Narayan Kamath
7462f02f82 Unify zipfile implementations : Step 1.
Extract zip file processing logic from libdvm into a
standalone library.

This library is a stricter than the libdvm library in
several ways:
- Duplicate zip entry names are now disallowed. Files with
  such entries will fail to parse.
- We now verify CD file size information with the individual
  file header information. (This was pointed out as a deficiency
  of this implementation in past discussions.)
- We also add support for crc checking, which means we might
  need to parse the optional data descriptor footer (if one
  exists).

We also provide an API for iterating over the entries of
a zip file. This library is optimized for two use cases :

- Lookup for a single entry in the file, with the intention
  of processing or extracting the data associated with that
  entry
- Iterating over all entries in a file *and* processing
  / extracting their data.

Change-Id: Ia87de6184ef753cc470b0af755c47a4f92ac8198
2013-12-04 13:28:40 +00:00