Extract dex file if it is uncompressed but unaligned
A dex file would normally only be left in the zip file if it was both
uncompressed and unaligned, but explicitly setting CopyOptions::kNever
through --copy-dex-file=false would only check if the dex file was
uncompressed, not if it was aligned. Add a required alignment
argument to ZipEntry::MapDirectlyOrExtract so that the contents
will be extracted into memory if they don't meet the alignment
requirement.
Bug: 119412419
Test: m test-art-host-gtest-oat_writer_test
Change-Id: I4587e22165ee0a951ffca7db9a6f5c0d1ed2e56a
diff --git a/libartbase/base/zip_archive.h b/libartbase/base/zip_archive.h
index d326a9e..fc04ec1 100644
--- a/libartbase/base/zip_archive.h
+++ b/libartbase/base/zip_archive.h
@@ -59,7 +59,8 @@
MemMap MapDirectlyOrExtract(const char* zip_filename,
const char* entry_filename,
- std::string* error_msg);
+ std::string* error_msg,
+ size_t alignment);
uint32_t GetUncompressedLength();
uint32_t GetCrc32();