Skip to content
Permalink
Browse files

Add support for Oat versions up to 173

The only relevant differences are some added/removed fields in the
OatHeader that affect the offsets of some fields we use.
  • Loading branch information...
JesusFreke committed Oct 2, 2019
1 parent 539353a commit b3b8778ef88d4111133e5b7ade10de1eb88962bc
Showing with 11 additions and 2 deletions.
  1. +3 −0 dexlib2/OatVersions.txt
  2. +8 −2 dexlib2/src/main/java/org/jf/dexlib2/dexbacked/OatFile.java
@@ -161,3 +161,6 @@ e35ac04a1a9a22b1c4386b27f3a30cd840aa17b1 - 169
98fb083a30e9b37685f943e2923e65e60e0a0971 - 170
- Removes the interpreter_to_interpreter_bridge_offset_ field in oat header
- Removes the interpreter_to_compiled_code_bridge_offset_ field in oat header
e42a4b95eed312e6f7019645f4c66b2d77254433 - 171
697c47a7ffd4489c4bc4edc229c8123309526286 - 172
6c4ec5c1555aaeddd254750c15554a3c47bfc722 - 173
@@ -59,7 +59,7 @@
// These are the "known working" versions that I have manually inspected the source for.
// Later version may or may not work, depending on what changed.
private static final int MIN_OAT_VERSION = 56;
private static final int MAX_OAT_VERSION = 86;
private static final int MAX_OAT_VERSION = 173;

public static final int UNSUPPORTED = 0;
public static final int SUPPORTED = 1;
@@ -251,7 +251,13 @@ public OatCDexFile(byte[] buf, int offset) {

public OatHeader(int offset) {
this.headerOffset = offset;
if (getVersion() >= 127) {
if (getVersion() >= 170) {
this.keyValueStoreOffset = 14 * 4;
} else if (getVersion() >= 166) {
this.keyValueStoreOffset = 16 * 4;
} else if (getVersion() >= 162) {
this.keyValueStoreOffset = 17 * 4;
} else if (getVersion() >= 127) {
this.keyValueStoreOffset = 19 * 4;
} else {
this.keyValueStoreOffset = 18 * 4;

0 comments on commit b3b8778

Please sign in to comment.
You can’t perform that action at this time.