From 0cba004b97245300d7f39318d5921ee8edbef1ac Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 29 Apr 2015 20:47:16 -0700 Subject: ART: Allow oat files with duplicates classes in corner case When the oat file is actually an odex file, that is, a preopted /system app, then it is impossible to fall back to the original APK, as that has been stripped. When it looks like it will be impossible to successfully open the original dex location, grudgingly allow to open the found oat file, even if it has duplicate classes, but warn accordingly. Bug: 20697582 Change-Id: I1dd459563d977a2e77806eacd03e49334d5b1f14 --- runtime/dex_file.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/dex_file.h') diff --git a/runtime/dex_file.h b/runtime/dex_file.h index 6b3f883a5d..84eaa4a73e 100644 --- a/runtime/dex_file.h +++ b/runtime/dex_file.h @@ -388,6 +388,10 @@ class DexFile { static bool Open(const char* filename, const char* location, std::string* error_msg, std::vector>* dex_files); + // Checks whether the given file has the dex magic, or is a zip file with a classes.dex entry. + // If this function returns false, Open will not succeed. The inverse is not true, however. + static bool MaybeDex(const char* filename); + // Opens .dex file, backed by existing memory static std::unique_ptr Open(const uint8_t* base, size_t size, const std::string& location, -- cgit v1.2.3-59-g8ed1b