Commit graph

23 commits

Author SHA1 Message Date
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