Package org.jf.baksmali
Class DexInputCommand
- java.lang.Object
-
- org.jf.util.jcommander.Command
-
- org.jf.baksmali.DexInputCommand
-
- Direct Known Subclasses:
DisassembleCommand,DumpCommand,ListClassesCommand,ListFieldOffsetsCommand,ListReferencesCommand,ListVtablesCommand
public abstract class DexInputCommand extends org.jf.util.jcommander.CommandThis class implements common functionality for commands that need to load a dex file based on command line input
-
-
Field Summary
Fields Modifier and Type Field Description intapiLevelprotected org.jf.dexlib2.iface.MultiDexContainer.DexEntry<? extends org.jf.dexlib2.dexbacked.DexBackedDexFile>dexEntryprotected org.jf.dexlib2.dexbacked.DexBackedDexFiledexFileprotected java.lang.StringinputEntryprotected java.io.FileinputFileprotected java.util.List<java.lang.String>inputList
-
Constructor Summary
Constructors Constructor Description DexInputCommand(java.util.List<com.beust.jcommander.JCommander> commandAncestors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidloadDexFile(java.lang.String input)Parses a dex file input from the user and loads the given dex file.
-
-
-
Field Detail
-
apiLevel
public int apiLevel
-
inputList
protected java.util.List<java.lang.String> inputList
-
inputFile
protected java.io.File inputFile
-
inputEntry
protected java.lang.String inputEntry
-
dexEntry
protected org.jf.dexlib2.iface.MultiDexContainer.DexEntry<? extends org.jf.dexlib2.dexbacked.DexBackedDexFile> dexEntry
-
dexFile
protected org.jf.dexlib2.dexbacked.DexBackedDexFile dexFile
-
-
Method Detail
-
loadDexFile
protected void loadDexFile(@Nonnull java.lang.String input)Parses a dex file input from the user and loads the given dex file. In some cases, the input file can contain multiple dex files. If this is the case, you can refer to a specific dex file with a slash, followed by the entry name, optionally in quotes. If the entry name is enclosed in quotes, then it will strip the first and last quote and look for an entry with exactly that name. Otherwise, it will perform a partial filename match against the entry to find any candidates. If there is a single matching candidate, it will be used. Otherwise, an error will be generated. For example, to refer to the "/system/framework/framework.jar:classes2.dex" entry within the "framework/arm/framework.oat" oat file, you could use any of: framework/arm/framework.oat/"/system/framework/framework.jar:classes2.dex" framework/arm/framework.oat/system/framework/framework.jar:classes2.dex framework/arm/framework.oat/framework/framework.jar:classes2.dex framework/arm/framework.oat/framework.jar:classes2.dex framework/arm/framework.oat/classes2.dex The last option is the easiest, but only works if the oat file doesn't contain another entry with the "classes2.dex" name. e.g. "/system/framework/blah.jar:classes2.dex" It's technically possible (although unlikely) for an oat file to contain 2 entries like: /system/framework/framework.jar:classes2.dex system/framework/framework.jar:classes2.dex In this case, the "framework/arm/framework.oat/system/framework/framework.jar:classes2.dex" syntax will generate an error because both entries match the partial entry name. Instead, you could use the following for the first and second entry respectively: framework/arm/framework.oat/"/system/framework/framework.jar:classes2.dex" framework/arm/framework.oat/"system/framework/framework.jar:classes2.dex"- Parameters:
input- The name of a dex, apk, odex or oat file/entry.
-
-