summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Lesinski2017-03-29 18:10:11 -0500
committerAdam Lesinski2017-04-06 19:03:32 -0500
commite2fa70bcb048566eff4d0e271288f24f0bdbc0a8 (patch)
tree6ff0407b9ef12c67958e576f004642377c1ab39c /include
parent0e19795a621ddb9912edc58b832f078405e485fd (diff)
downloadplatform-system-core-e2fa70bcb048566eff4d0e271288f24f0bdbc0a8.tar.gz
platform-system-core-e2fa70bcb048566eff4d0e271288f24f0bdbc0a8.tar.xz
platform-system-core-e2fa70bcb048566eff4d0e271288f24f0bdbc0a8.zip
ZipWriter: Do not write DataDescriptor for STORED files
Older implementations of ZIP (Java's ZipInputStream) don't like a Data Descriptor trailing after an uncompressed entry. If the FILE is seekable, and the entry is uncompressed, seek back to the header and write out the crc and sizes. (cherry-pick of commit 639814d946867c20537820cd0c08a6202a251583) Bug: 36686974 Test: make ziparchive_tests Change-Id: I61664515e5afa3e2ba814874eeac847a2aaac319
Diffstat (limited to 'include')
-rw-r--r--include/ziparchive/zip_writer.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/ziparchive/zip_writer.h b/include/ziparchive/zip_writer.h
index 41ca2e1a3..08ead4845 100644
--- a/include/ziparchive/zip_writer.h
+++ b/include/ziparchive/zip_writer.h
@@ -75,7 +75,8 @@ public:
75 uint32_t uncompressed_size; 75 uint32_t uncompressed_size;
76 uint16_t last_mod_time; 76 uint16_t last_mod_time;
77 uint16_t last_mod_date; 77 uint16_t last_mod_date;
78 uint32_t local_file_header_offset; 78 uint32_t padding_length;
79 off64_t local_file_header_offset;
79 }; 80 };
80 81
81 static const char* ErrorCodeString(int32_t error_code); 82 static const char* ErrorCodeString(int32_t error_code);
@@ -172,6 +173,7 @@ private:
172 }; 173 };
173 174
174 FILE* file_; 175 FILE* file_;
176 bool seekable_;
175 off64_t current_offset_; 177 off64_t current_offset_;
176 State state_; 178 State state_;
177 std::vector<FileEntry> files_; 179 std::vector<FileEntry> files_;