summaryrefslogtreecommitdiff
path: root/runtime/oat_file_assistant.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2018-02-28 13:27:55 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2018-02-28 13:31:13 +0000
commit66ff8a8b82ff103d48d40e8dad01342c2d6f6d0d (patch)
treef1e177b7276d0387bc109fa12e6bd4cde060d5e9 /runtime/oat_file_assistant.cc
parent878124c13b794900b0f5c437f52ac0f61538ab55 (diff)
Revert "Revert "Full-stack integrity: check vdex contents.""
bug: 30972906 Initial revert due to 'check' file of the test needing updating for target tests. This reverts commit a19b7649faf8780737be7ce3ec48a12d81c6d69f. Change-Id: I455780bd88cd89ff80c9084d399e2beeb819b95f
Diffstat (limited to 'runtime/oat_file_assistant.cc')
-rw-r--r--runtime/oat_file_assistant.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/runtime/oat_file_assistant.cc b/runtime/oat_file_assistant.cc
index 0170073e29..6bf05b77a8 100644
--- a/runtime/oat_file_assistant.cc
+++ b/runtime/oat_file_assistant.cc
@@ -515,6 +515,18 @@ OatFileAssistant::OatStatus OatFileAssistant::GivenOatFileStatus(const OatFile&
VLOG(oat) << "Image checksum test skipped for compiler filter " << current_compiler_filter;
}
+ // zip_file_only_contains_uncompressed_dex_ is only set during fetching the dex checksums.
+ DCHECK(required_dex_checksums_attempted_);
+ if (only_load_system_executable_ &&
+ !LocationIsOnSystem(file.GetLocation().c_str()) &&
+ file.ContainsDexCode() &&
+ zip_file_only_contains_uncompressed_dex_) {
+ LOG(ERROR) << "Not loading "
+ << dex_location_
+ << ": oat file has dex code, but APK has uncompressed dex code";
+ return kOatDexOutOfDate;
+ }
+
if (CompilerFilter::IsAotCompilationEnabled(current_compiler_filter)) {
if (!file.IsPic()) {
const ImageInfo* image_info = GetImageInfo();
@@ -879,7 +891,8 @@ const std::vector<uint32_t>* OatFileAssistant::GetRequiredDexChecksums() {
if (dex_file_loader.GetMultiDexChecksums(dex_location_.c_str(),
&cached_required_dex_checksums_,
&error_msg,
- zip_fd_)) {
+ zip_fd_,
+ &zip_file_only_contains_uncompressed_dex_)) {
required_dex_checksums_found_ = true;
has_original_dex_files_ = true;
} else {