summaryrefslogtreecommitdiff
path: root/runtime/class_loader_context.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2020-03-16 14:02:31 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2020-03-17 08:48:28 +0000
commitbf7705509ea10d1f172bd37200ebbb6472a139a3 (patch)
tree32bd810acc8e00b23b0f88257100ac8bdcafc1a1 /runtime/class_loader_context.cc
parent03008223bc443c2e7a411d6595671e376dea0a9b (diff)
Don't run structural dex file verification in ClassLoaderContext.
ClassLoaderContext should only ensure that checksums match, structural dex file verification should happen when the runtime or the compiler runs a dex file. Test: boots and no regression Bug: 150032912 Change-Id: I23afc92bb01a4ce662c143638b2f2550e6ee6531
Diffstat (limited to 'runtime/class_loader_context.cc')
-rw-r--r--runtime/class_loader_context.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/class_loader_context.cc b/runtime/class_loader_context.cc
index d2a1b7fb83..98db62ef38 100644
--- a/runtime/class_loader_context.cc
+++ b/runtime/class_loader_context.cc
@@ -455,10 +455,12 @@ bool ClassLoaderContext::OpenDexFiles(InstructionSet isa,
std::string error_msg;
// When opening the dex files from the context we expect their checksum to match their
// contents. So pass true to verify_checksum.
+ // We don't need to do structural dex file verification, we only need to
+ // check the checksum, so pass false to verify.
if (fd < 0) {
if (!dex_file_loader.Open(location.c_str(),
location.c_str(),
- Runtime::Current()->IsVerificationEnabled(),
+ /*verify=*/ false,
/*verify_checksum=*/ true,
&error_msg,
&info->opened_dex_files)) {
@@ -484,7 +486,7 @@ bool ClassLoaderContext::OpenDexFiles(InstructionSet isa,
}
} else if (!dex_file_loader.Open(fd,
location.c_str(),
- Runtime::Current()->IsVerificationEnabled(),
+ /*verify=*/ false,
/*verify_checksum=*/ true,
&error_msg,
&info->opened_dex_files)) {