Support the -i flag in the new dexdump.
Rationale:
The old dexdump supported the -i feature (ignore checksum failures).
This CL adds the same functionality to the new dexdump. Note that
this feature is, for example, useful to inspect DEX files that are
extracted from images (with quickened instructions), since the
checksum is not always valid in those cases.
BUG=29548017
Change-Id: I6017b2f3d789f450560b568297f43c62bf9453b1
diff --git a/dexlist/dexlist.cc b/dexlist/dexlist.cc
index d20c169..6f19df5 100644
--- a/dexlist/dexlist.cc
+++ b/dexlist/dexlist.cc
@@ -180,9 +180,10 @@
static int processFile(const char* fileName) {
// If the file is not a .dex file, the function tries .zip/.jar/.apk files,
// all of which are Zip archives with "classes.dex" inside.
+ static constexpr bool kVerifyChecksum = true;
std::string error_msg;
std::vector<std::unique_ptr<const DexFile>> dex_files;
- if (!DexFile::Open(fileName, fileName, &error_msg, &dex_files)) {
+ if (!DexFile::Open(fileName, fileName, kVerifyChecksum, &error_msg, &dex_files)) {
fputs(error_msg.c_str(), stderr);
fputc('\n', stderr);
return -1;