summaryrefslogtreecommitdiffstats
path: root/libziparchive
Commit message (Collapse)AuthorAgeFilesLines
* am 7a92d20e: Merge "Clean up some test makefiles."Dan Albert2014-11-051-20/+12
|\ | | | | | | | | * commit '7a92d20ec845c07472eaea7cf14fd0e69df836ef': Clean up some test makefiles.
| * Clean up some test makefiles.Dan Albert2014-11-041-20/+12
| | | | | | | | | | | | | | Needed for building with libc++ as the default STL. Bug: 15193147 Change-Id: I8b462bd288fbea7e0ab182f85ffcbf438afb6aa4
* | am b968d5c8: Merge "Add shared library version of libziparchive."Ian Rogers2014-10-301-2/+15
|\ \ | |/ | | | | | | * commit 'b968d5c8468c9b0707f88f773fae16074e9018cf': Add shared library version of libziparchive.
| * Add shared library version of libziparchive.Ian Rogers2014-10-301-2/+15
| | | | | | | | Change-Id: I9abded3bbff0e7976b1849c73e6978dd10ca84cd
* | am cd1da4e0: Fix toolchain issue for windows build of libziparchive.Xavier Ducrohet2014-10-161-0/+3
|\ \ | |/ |/| | | | | * commit 'cd1da4e04f0eb71a92a586c66acd0e34115608e1': Fix toolchain issue for windows build of libziparchive.
| * Fix toolchain issue for windows build of libziparchive.Xavier Ducrohet2014-10-161-0/+3
| | | | | | | | | | | | | | | | | | | | 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
| * Reject zip archives with entry names containing \0.Piotr Jastrzebski2014-08-261-1/+7
| | | | | | | | | | | | | | | | | | | | There should never be a need of an entry name with \0 character. Bug: 16162465 (cherry picked from commit 78271ba97b5d867e3597b7fc2257dd1bbd513b05) Change-Id: I68c72fb45e8ec70eb125cfc887488bc18ba5447d
| * Prevent the accidental closure of fd[0] for missing zip files.Neil Fuller2014-07-282-22/+33
| | | | | | | | | | | | | | (cherry picked from commit b1a113f618561b274ab793e6401416d449c60449) Bug: 16530747 Change-Id: I0d1be3dcadfa5128ffe04cec60f6c998dff61991
* | Merge "Reject zip archives with entry names containing \0."Piotr Jastrzebski2014-08-161-1/+7
|\ \
| * | Reject zip archives with entry names containing \0.Piotr Jastrzebski2014-08-191-1/+7
| | | | | | | | | | | | | | | | | | | | | There should never be a need of an entry name with \0 character. Bug: 16162465 Change-Id: Ia2ec57959280c1bb972c4d59d890c8540c5b9081
* | | Cleanup ziparchivePiotr Jastrzebski2014-08-191-3/+4
|/ / | | | | | | | | | | Addressed review comments from 8e08536108d2b5a7f4f9a4b008987b54602fda18 Change-Id: If576e2d6cc5ad330a7dee66b09663e0c04ea3801
* | Fix win_sdk build by not using vectorPiotr Jastrzebski2014-08-182-12/+20
| | | | | | | | Change-Id: I4e9ee4286ea29e1f5f2ee477525e79bfa16ad9a0
* | Replace char* with ZipEntryName in ziparchive API.Piotr Jastrzebski2014-08-153-48/+86
| | | | | | | | | | | | | | | | | | 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
* | Revert "Make sure that names of all entries have the same encoding."Piotr Jastrzebski2014-08-131-20/+1
| | | | | | | | | | | | This reverts commit 6a7f4bb79dde575d30af562af916b572b80ff9c3. Change-Id: Id4f5b601ff0b9d82ce2c9beeb9162eba9594b3a7
* | Make sure that names of all entries have the same encoding.Piotr Jastrzebski2014-08-131-1/+20
| | | | | | | | | | | | | | | | Add new public method to allow checkisc if an archive has entry names encoded in UTF-8. If not then they will be encoded in IBM PC character encoding. Bug: 16162465 Change-Id: I4468d76accca8a9b0b31cae8d43399ffc22cad42
* | Make a copy of a prefix param in StartIterationPiotr Jastrzebski2014-08-111-1/+7
| | | | | | | | | | | | and delete it in EndIteration. Change-Id: I4de4167700a9dba3119fde22fcd45725742f3731
* | Add EndIteration method to free memory allocatedPiotr Jastrzebski2014-08-111-0/+6
| | | | | | | | | | | | | | in StartIteration. This method should always be called when the iteration is over to make sure that we don't leak memory. Change-Id: I5205c754dfafbab9bb5f06003c3663d2ec4e8a35
* | Merge "Prevent the accidental closure of fd[0] for missing zip files."Neil Fuller2014-07-232-22/+33
|\ \
| * | Prevent the accidental closure of fd[0] for missing zip files.Neil Fuller2014-07-252-22/+33
| |/ | | | | | | | | Bug: 16530747 Change-Id: I3593f2bc4d56a2f91252ea795c90ce3c78e1ec06
* | Update makefiles for host clang.Tim Murray2014-07-241-1/+2
|/ | | | | | bug 16172793 Change-Id: If7484c5dbcccce7d925bec97bff0a3e4c30e9434
* Enable host multilib for ART testing.Ian Rogers2014-06-171-0/+1
| | | | Change-Id: Ic3ae5122eba13565fb5a4cb1bd0e7e465fb2140c
* Replace hand written offsets with structures.Narayan Kamath2014-06-102-160/+272
| | | | | | | | | | | | | | Given that all current & future android ABIs are little endian, we can get rid of the explicit conversions from memory regions to little endian data members. Also cleans up a few C style casts that snuck in during several -Werror efforts and fixes temporary file generation on target. bug: 15448202 Change-Id: I4fcbb3c1124cb82c82139d328344e54fc7895353
* Fix build.Narayan Kamath2014-06-061-2/+2
| | | | | | Uncommitted changes from a rename. Change-Id: If1cac7104c436970f905eede683040ae79529292
* Reject zip files that have trailing bytes after their CD.Narayan Kamath2014-06-052-12/+38
| | | | | bug: 15287086 Change-Id: I03219c4c2ca6afc9d417a35bd98ae682f478fc25
* Fix host 64-bit build.Ying Wang2014-05-161-2/+2
| | | | | Bug: 13751317 Change-Id: Ib42d24408d053bacc24142ed18fc5f3181d2345b
* libziparchive: off64_t is not int64_t (part deux)Mark Salyzyn2014-05-081-4/+4
| | | | Change-Id: I38e78bdba338a0c40aec43d6c86f26f388cee6ab
* libziparchive: off64_t is not int64_tMark Salyzyn2014-05-081-10/+10
| | | | | | - ToDo: investigate why our system headers let us down. Change-Id: Iada422adbbbd4fbd0fc09b51b97b3cd06ccc6374
* libziparchive: 64 bit issuesMark Salyzyn2014-05-081-12/+13
| | | | Change-Id: I1b53aff5b1527a3623d17deed306624707d345ef
* libziparchive: Turn on -WerrorMark Salyzyn2014-05-072-6/+11
| | | | Change-Id: I98a93273b9e1bac0324dd210f6a8493ba780e878
* libziparchive: 64 bit compile issuesMark Salyzyn2014-03-141-29/+29
| | | | | | - All within LOG messages. Change-Id: I52e81b49e8127276359c62febd4cc1d8d69102d9
* Add free to CloseArchive.Mathieu Chartier2014-03-041-7/+1
| | | | | | | | Currently CloseArchive doesn't call free and call sites don't appear to either. I could not find any call sites which manually freed the archive by deleting the handle. This fixes several memory leaks. Change-Id: I21f187dde60fd87e6e54bde06de9e76fd0791104
* Fix logging errors inside ALOGVColin Cross2014-02-071-1/+1
| | | | | | Fix errors exposed by adding checking to disabled ALOGVs. Change-Id: I36b77bb0ad8dc7661b0f834f20d1179b86134d57
* Fix entry handling for 0 length entries.Narayan Kamath2014-01-242-2/+46
| | | | | | | | | | | | | | | | Two minor issues were fixed: - The offset to entry data can be the same as the central directory offset when the last entry in the file has length 0 and is stored (not deflated). Fix a check that disallowed this. We already have a strict check that entry data must end before the central directory, so we're covered. - We would attempt to map a segment of length 0 when writing an entry whose length is 0. We should just return early in this case. bug: 12623277 Change-Id: I2a4ca0c4d170cc3cbf326e5ca13894acd9c434c9
* Merge "Fix a sporadic build breakage."Elliott Hughes2014-01-031-1/+1
|\
| * Fix a sporadic build breakage.Narayan Kamath2014-01-031-1/+1
| | | | | | | | | | | | | | | | | | 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
* | Change a debug log to a verbose log.Narayan Kamath2014-01-021-1/+1
|/ | | | | | | | Unlike ALOGV, messages from ALOGD are logged on all configurations. Not finding an entry in a zip file is a "normal" occurrence so using an ALOGD message for it amounts to spam. Change-Id: I2c60d11e8a750be5106afd65c3c5e335f53f01b6
* Fix ExtractEntryToFile.Narayan Kamath2013-12-132-4/+53
| | | | | | | | | We would always write uncompressed data at offset 0 instead of the current filedescriptor offset. Also adds a unit-test & a clarifying comment on the API. Change-Id: If44757e96dde504ce63d81b4dec7115fc6f6d5fb
* Merge "Get rid of some log spam."Narayan Kamath2013-12-121-1/+1
|\
| * Get rid of some log spam.Narayan Kamath2013-12-121-1/+1
| | | | | | | | | | | | | | We don't need a warning if an entry isn't found in a zip file. It can happen as part of normal operation. Change-Id: I86c132a040371f36f0dd981b49c02b3173821439
* | Use FileMap from libcutil instead of rolling our own.Narayan Kamath2013-12-112-75/+43
|/ | | | | | Adds windows support as a side effect. Change-Id: I912c1f980f284d01d4f3936291999646ddf6250a
* Add unit tests for libziparchive.Narayan Kamath2013-12-104-15/+155
| | | | | | | | | - 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
* Fix return code for ended iteration.Narayan Kamath2013-12-091-6/+6
| | | | | | | | The API promises a return code of -1 for an ended iteration and lower negative values for errors. Change-Id: I688a1ee2efad1bdfc6959cf27e49c0426ebf27f8
* Unify zipfile implementations : Step 1.Narayan Kamath2013-12-043-0/+1173
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