summaryrefslogtreecommitdiffstats
path: root/runtime/dex_file.h
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-04-29 20:47:16 -0700
committerAndreas Gampe <agampe@google.com>2015-04-29 21:23:49 -0700
commit8b83b55de8abbc195c038789f1034107f4974597 (patch)
tree0a2560d677ca38256b728c71c716dbbf2db0016b /runtime/dex_file.h
parent61d7ca870b7afc5400e6f7dd2952ca06ce7f7bac (diff)
downloadart-8b83b55de8abbc195c038789f1034107f4974597.tar.gz
art-8b83b55de8abbc195c038789f1034107f4974597.tar.bz2
art-8b83b55de8abbc195c038789f1034107f4974597.zip
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 (cherry picked from commit 0cba004b97245300d7f39318d5921ee8edbef1ac) Change-Id: I1dd459563d977a2e77806eacd03e49334d5b1f14
Diffstat (limited to 'runtime/dex_file.h')
-rw-r--r--runtime/dex_file.h4
1 files changed, 4 insertions, 0 deletions
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<std::unique_ptr<const DexFile>>* 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<const DexFile> Open(const uint8_t* base, size_t size,
const std::string& location,