Class DexInputCommand

    • Field Summary

      Fields 
      Modifier and Type Field Description
      int apiLevel  
      protected org.jf.dexlib2.iface.MultiDexContainer.DexEntry<? extends org.jf.dexlib2.dexbacked.DexBackedDexFile> dexEntry  
      protected org.jf.dexlib2.dexbacked.DexBackedDexFile dexFile  
      protected java.lang.String inputEntry  
      protected java.io.File inputFile  
      protected java.util.List<java.lang.String> inputList  
      • Fields inherited from class org.jf.util.jcommander.Command

        commandAncestors
    • 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 void loadDexFile​(java.lang.String input)
      Parses a dex file input from the user and loads the given dex file.
      • Methods inherited from class org.jf.util.jcommander.Command

        getCommandHierarchy, getJCommander, run, setupCommand, usage
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • DexInputCommand

        public DexInputCommand​(@Nonnull
                               java.util.List<com.beust.jcommander.JCommander> commandAncestors)
    • 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.