diff options
author | Ben Gruver <bgruv@google.com> | 2017-05-15 16:25:10 -0700 |
---|---|---|
committer | Ben Gruver <bgruv@google.com> | 2017-05-15 17:01:44 -0700 |
commit | dd22a795d86aa1461d85c452cae7b7b811c462e2 (patch) | |
tree | 7ba34f5f1928534bbcfa0ff42f734b7aff5b0462 | |
parent | 58a4809720867b8f11d907ee83f1f20839499fc2 (diff) | |
download | smali-dd22a795d86aa1461d85c452cae7b7b811c462e2.tar.gz |
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.
-rw-r--r-- | baksmali/src/main/java/org/jf/baksmali/DisassembleCommand.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/baksmali/src/main/java/org/jf/baksmali/DisassembleCommand.java b/baksmali/src/main/java/org/jf/baksmali/DisassembleCommand.java index 2e3eb79e..eb670df4 100644 --- a/baksmali/src/main/java/org/jf/baksmali/DisassembleCommand.java +++ b/baksmali/src/main/java/org/jf/baksmali/DisassembleCommand.java @@ -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; } } |