Add an option to baksmali to allow disassembling odex opcodes

These instructions should never be present in a dex file, only in odex/oat
files. However, it's sometimes useful to be able to disassemble an otherwise
valid dex file that happens to contain odex instructions.
This commit is contained in:
Ben Gruver 2017-05-15 16:25:10 -07:00
parent 58a4809720
commit dd22a795d8

View File

@ -132,6 +132,10 @@ public class DisassembleCommand extends DexInputCommand {
"fields from the current class.")
private boolean implicitReferences = false;
@Parameter(names = "--allow-odex-opcodes",
description = "Allows odex opcodes to be disassembled, even if the result won't be able to be reassembled.")
private boolean allowOdex = false;
@Parameter(names = "--classes",
description = "A comma separated list of classes. Only disassemble these classes")
@ExtendedParameter(argumentNames = "classes")
@ -282,6 +286,10 @@ public class DisassembleCommand extends DexInputCommand {
dexFile.getClasses());
}
if (allowOdex) {
options.allowOdex = true;
}
return options;
}
}