Fix the dump command to work with dex files in an oat file

This commit is contained in:
Ben Gruver 2016-08-28 13:13:31 -07:00
parent 36be93a76a
commit 41a5b4953c
2 changed files with 2 additions and 2 deletions

View File

@ -118,7 +118,7 @@ public class DumpCommand extends DexInputCommand {
consoleWidth = 120; consoleWidth = 120;
} }
RawDexFile rawDexFile = new RawDexFile(Opcodes.forApi(apiLevel), dexFile); RawDexFile rawDexFile = new RawDexFile(dexFile.getOpcodes(), dexFile);
DexAnnotator annotator = new DexAnnotator(rawDexFile, consoleWidth); DexAnnotator annotator = new DexAnnotator(rawDexFile, consoleWidth);
annotator.writeAnnotations(writer); annotator.writeAnnotations(writer);
} }

View File

@ -93,7 +93,7 @@ public class DexBackedDexFile extends BaseDexBuffer implements DexFile {
} }
public DexBackedDexFile(@Nonnull Opcodes opcodes, @Nonnull BaseDexBuffer buf) { public DexBackedDexFile(@Nonnull Opcodes opcodes, @Nonnull BaseDexBuffer buf) {
this(opcodes, buf.buf); this(opcodes, buf.buf, buf.baseOffset);
} }
public DexBackedDexFile(@Nonnull Opcodes opcodes, @Nonnull byte[] buf, int offset) { public DexBackedDexFile(@Nonnull Opcodes opcodes, @Nonnull byte[] buf, int offset) {