summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdex/DexFile.h5
-rw-r--r--libdex/DexSwapVerify.cpp3
2 files changed, 7 insertions, 1 deletions
diff --git a/libdex/DexFile.h b/libdex/DexFile.h
index e8ab31924..593d4142a 100644
--- a/libdex/DexFile.h
+++ b/libdex/DexFile.h
@@ -87,6 +87,11 @@ typedef int64_t s8;
/* DEX file magic number */
#define DEX_MAGIC "dex\n"
+/* The version for android N, encoded in 4 bytes of ASCII. This differentiates dex files that may
+ * use default methods.
+ */
+#define DEX_MAGIC_VERS_37 "037\0"
+
/* current version, encoded in 4 bytes of ASCII */
#define DEX_MAGIC_VERS "036\0"
diff --git a/libdex/DexSwapVerify.cpp b/libdex/DexSwapVerify.cpp
index 46ce14171..2b653b80b 100644
--- a/libdex/DexSwapVerify.cpp
+++ b/libdex/DexSwapVerify.cpp
@@ -2792,7 +2792,8 @@ bool dexHasValidMagic(const DexHeader* pHeader)
}
if ((memcmp(version, DEX_MAGIC_VERS, 4) != 0) &&
- (memcmp(version, DEX_MAGIC_VERS_API_13, 4) != 0)) {
+ (memcmp(version, DEX_MAGIC_VERS_API_13, 4) != 0) &&
+ (memcmp(version, DEX_MAGIC_VERS_37, 4) != 0)) {
/*
* Magic was correct, but this is an unsupported older or
* newer format variant.