aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLanchon <lanchon@gmail.com>2018-06-14 03:49:40 -0300
committerBen Gruver <jesusfreke@jesusfreke.com>2018-07-02 11:33:20 -0700
commit9560bfe2a0f5c8566de4ece5a83bbc95db8bfabb (patch)
tree1d72113632c685f02c89d9a0ba51134bfac5209a
parent1e984c297038cf672fa79d649d95c0c118f53c26 (diff)
downloadsmali-9560bfe2a0f5c8566de4ece5a83bbc95db8bfabb.tar.gz
Remove the redundant SUPPORTED_DEX_VERSIONS array
-rw-r--r--dexlib2/src/main/java/org/jf/dexlib2/dexbacked/raw/HeaderItem.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/dexlib2/src/main/java/org/jf/dexlib2/dexbacked/raw/HeaderItem.java b/dexlib2/src/main/java/org/jf/dexlib2/dexbacked/raw/HeaderItem.java
index 0456d671..f7b7b0b2 100644
--- a/dexlib2/src/main/java/org/jf/dexlib2/dexbacked/raw/HeaderItem.java
+++ b/dexlib2/src/main/java/org/jf/dexlib2/dexbacked/raw/HeaderItem.java
@@ -44,7 +44,6 @@ public class HeaderItem {
public static final int ITEM_SIZE = 0x70;
private static final byte[] MAGIC_VALUE = new byte[] { 0x64, 0x65, 0x78, 0x0a, 0x00, 0x00, 0x00, 0x00 };
- private static final int[] SUPPORTED_DEX_VERSIONS = new int[] { 35, 37, 38, 39 };
public static final int LITTLE_ENDIAN_TAG = 0x12345678;
public static final int BIG_ENDIAN_TAG = 0x78563412;
@@ -303,12 +302,12 @@ public class HeaderItem {
}
public static boolean isSupportedDexVersion(int version) {
- for (int i=0; i<SUPPORTED_DEX_VERSIONS.length; i++) {
- if (SUPPORTED_DEX_VERSIONS[i] == version) {
- return true;
- }
+ try {
+ VersionMap.mapDexVersionToApi(version);
+ return true;
+ } catch (RuntimeException e) {
+ return false;
}
- return false;
}
public static int getEndian(byte[] buf, int offset) {