diff options
author | Narayan Kamath <narayan@google.com> | 2013-11-28 14:06:24 +0000 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2013-12-09 10:19:24 +0000 |
commit | 92572be7f754c213e615a62955cc5f65ca8c0c0e (patch) | |
tree | 5d9266c16a5b110bacf1ec6062a46a3e33e16bcb /runtime/dex_file.cc | |
parent | 1a7e7d6a885bded1ffcdc8ff2490632698dc5139 (diff) | |
download | art-92572be7f754c213e615a62955cc5f65ca8c0c0e.zip art-92572be7f754c213e615a62955cc5f65ca8c0c0e.tar.gz art-92572be7f754c213e615a62955cc5f65ca8c0c0e.tar.bz2 |
Use libziparchive for art zip processing.
This is part of the effort to move all VM & framework
zip parsing to a common implementation. This also has
the side effect of fixing various TODOs related to
crc32 checking.
bug: 10193060
Change-Id: I407f9ad5a94fc91d96ff43556adde00a00df1f14
Diffstat (limited to 'runtime/dex_file.cc')
-rw-r--r-- | runtime/dex_file.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/dex_file.cc b/runtime/dex_file.cc index 517f96c..463e673 100644 --- a/runtime/dex_file.cc +++ b/runtime/dex_file.cc @@ -98,9 +98,10 @@ bool DexFile::GetChecksum(const char* filename, uint32_t* checksum, std::string* *error_msg = StringPrintf("Failed to open zip archive '%s'", filename); return false; } - UniquePtr<ZipEntry> zip_entry(zip_archive->Find(kClassesDex)); + UniquePtr<ZipEntry> zip_entry(zip_archive->Find(kClassesDex, error_msg)); if (zip_entry.get() == NULL) { - *error_msg = StringPrintf("Zip archive '%s' doesn\'t contain %s", filename, kClassesDex); + *error_msg = StringPrintf("Zip archive '%s' doesn\'t contain %s (error msg: %s)", filename, + kClassesDex, error_msg->c_str()); return false; } *checksum = zip_entry->GetCrc32(); @@ -240,9 +241,8 @@ const DexFile* DexFile::OpenMemory(const std::string& location, const DexFile* DexFile::Open(const ZipArchive& zip_archive, const std::string& location, std::string* error_msg) { CHECK(!location.empty()); - UniquePtr<ZipEntry> zip_entry(zip_archive.Find(kClassesDex)); + UniquePtr<ZipEntry> zip_entry(zip_archive.Find(kClassesDex, error_msg)); if (zip_entry.get() == NULL) { - *error_msg = StringPrintf("Failed to find classes.dex within '%s'", location.c_str()); return nullptr; } UniquePtr<MemMap> map(zip_entry->ExtractToMemMap(kClassesDex, error_msg)); |