mirror of
https://github.com/chenxiaolong/avbroot.git
synced 2026-07-03 14:05:11 +02:00
e397998d9e
The zip crate gained support for streaming writes in its master branch, so we can finally upgrade from our ancient fork of it. The new implementation is done a bit differently, with seekable writers having the ZipWriter<W> type and streaming writers having the ZipWriter<StreamWriter<W>> type. This forces us to add a new wrapper type since we have to switch between them at runtime. We still need to maintain a (hopefully temporary) fork of the crate due to a few issues: 1. There's no way to get the original underlying writer instance back after finalizing a streaming zip. A fix for this has been submitted upstream: https://github.com/zip-rs/zip2/pull/367 2. The streaming writes implementation does not include the magic signature for data descriptors. While the zip spec says the magic value is optional and parsers should not require it, older versions of Android's libziparchive do. A fix for this has been submitted upstream: https://github.com/zip-rs/zip2/pull/368 3. There is currently no way to get the data offset of zip entries. avbroot requires this to fill in the OTA metadata's "property files" entries, which Android uses to read file data without parsing the zip file structures. This new zip update produces files that are slightly different to before. The "version made by" and "version needed to extract" fields are now set to their minimum possible values. Previously, the zip crate was hardcoded to use versions 4.6 and 2.0, respectively. Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>