Interface IDexMethod

All Superinterfaces:
ICodeItem, ICodeMethod, IDexItem

public interface IDexMethod extends IDexItem, ICodeMethod
This interface represents a Dex method_id_item object, that is, a reference to an internal or external method used in the dex. Retrieved via IDexUnit.
  • Method Details

    • getIndex

      int getIndex()
      Get the index of this item in the Dex file's method list.
      Specified by:
      getIndex in interface ICodeItem
      Returns:
      the method index
    • getReturnType

      IDexType getReturnType()
      Description copied from interface: ICodeMethod
      Get the method's return type.
      Specified by:
      getReturnType in interface ICodeMethod
      Returns:
      the return type, null if unknown
    • getParameterTypes

      List<IDexType> getParameterTypes()
      Retrieve the list of parameters. For non-static methods, `this` is implied and is not provided as the first parameter of the returned list.
      Specified by:
      getParameterTypes in interface ICodeMethod
      Returns:
      the parameter types, null if unknown
    • getData

      IDexMethodData getData()
      Get a reference to the method definition, if the method is internal.
      Returns:
      the methods data, null for external methods
    • getClassType

      IDexType getClassType()
      Description copied from interface: ICodeMethod
      Get the type of the class holding this method. This method will return null if the method is class-less (example, a native sub-routine not contained in any class).
      Specified by:
      getClassType in interface ICodeMethod
      Returns:
      the class type, null if unknown
    • getClassTypeIndex

      int getClassTypeIndex()
      Get the containing class type index.
      Returns:
      the class type index
    • getClassTypeSignature

      String getClassTypeSignature(boolean effective)
    • getPrototypeIndex

      int getPrototypeIndex()
      Get the method prototype index.
      Returns:
      the prototype index
    • getPrototype

      IDexPrototype getPrototype()
    • getNameIndex

      int getNameIndex()
      Get the method name index.
      Returns:
      the name index
    • getName

      String getName(boolean effective)
      Get the name for this method.
      Specified by:
      getName in interface ICodeItem
      Parameters:
      effective - true to get the actual name, false to return the original name (if the unit allows the modification of items)
      Returns:
      the name
    • getSignature

      String getSignature(boolean effective)
      Get the signature for this method.
      Specified by:
      getSignature in interface ICodeItem
      Parameters:
      effective - true to get the actual signature, false to return the original signature (if the unit allows the modification of items)
      Returns:
      the signature
    • getSignature

      String getSignature(boolean effective, boolean internal)
      Description copied from interface: ICodeItem
      Get the item signature.
      Specified by:
      getSignature in interface ICodeItem
      Parameters:
      effective - true to get the actual signature, false to return the original signature (if the unit allows the modification of items)
      internal - true to generate internal names (default); false to generate user-friendly signatures (may be the same as the internal signatures)
      Returns:
      the signature
    • getSignature

      String getSignature(boolean effective, boolean internal, boolean includeReturnType)
    • getSignature

      String getSignature(boolean effective, boolean internal, boolean includeReturnType, boolean qualifiedNames)
    • setName

      boolean setName(String name)
      Rename this method. The method overrides and/or definition are renamed consistently. This method does not notify changes on success: it is up to the user to issue a J.UnitChange notification.

      This method is for convenience only: users can always use the associated unit's RENAME action (through the executeAction method) to rename an item generically.

      Parameters:
      name - the new name
      Returns:
      success indicator
    • getDebugVariablesMap

      SortedMap<Integer,List<IDexDebugVariable>> getDebugVariablesMap()
      Retrieve a high-level map of variables defined in the debug information of this method. The method must be internal.
      Returns:
      null if there is no debug information for the method. Else, a map of instruction offset (in bytes) to the list of existing debug variables defined when the instruction is to be executed
    • getParameterName

      String getParameterName(int index)
      Set a parameter name.

      Note: names are used by the decompiler.

      Parameters:
      index - 0-based parameter index (`this` is not-considered a parameter by this method)
      Returns:
      the manually set name, or null if there is none or an automatically-generated name is provided
    • setParameterName

      boolean setParameterName(int index, String name, boolean failOnNameConflict, boolean notify)
      Set a parameter name.

      Note: names are used by the decompiler.

      Parameters:
      index - 0-based parameter index (`this` is not-considered a parameter by this method)
      name - the manually set name, or null to reset to a default name
      failOnNameConflict - verify if the new name will not conflict with another parameter or variable name of this method
      notify - true to notify listeners if the parameter name has effectively changed
      Returns:
      change indicator