Interface IDexMethod
- All Superinterfaces:
ICodeItem
,ICodeMethod
,IDexItem
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
.-
Field Summary
Fields inherited from interface com.pnfsoftware.jeb.core.units.code.ICodeItem
FLAG_ABSTRACT, FLAG_ANNOTATION, FLAG_ANONYMOUS, FLAG_ARTIFICIAL, FLAG_BRIDGE, FLAG_CONSTRUCTOR, FLAG_DECLARED_SYNCHRONIZED, FLAG_DESTRUCTOR, FLAG_ENUM, FLAG_FINAL, FLAG_INNER, FLAG_INTERFACE, FLAG_INTERNAL, FLAG_NATIVE, FLAG_PRIVATE, FLAG_PROTECTED, FLAG_PUBLIC, FLAG_STATIC, FLAG_STRICT, FLAG_SYNCHRONIZED, FLAG_SYNTHETIC, FLAG_TRANSIENT, FLAG_VARARGS, FLAG_VIRTUAL, FLAG_VOLATILE
-
Method Summary
Modifier and TypeMethodDescriptionGet the type of the class holding this method.int
Get the containing class type index.getClassTypeSignature
(boolean effective) getData()
Get a reference to the method definition, if the method is internal.Retrieve a high-level map of variables defined in the debug information of this method.int
getIndex()
Get the index of this item in the Dex file's method list.getName
(boolean effective) Get the name for this method.int
Get the method name index.getParameterName
(int index) Set a parameter name.Retrieve the list of parameters.int
Get the method prototype index.Get the method's return type.getSignature
(boolean effective) Get the signature for this method.getSignature
(boolean effective, boolean internal) Get the item signature.getSignature
(boolean effective, boolean internal, boolean includeReturnType) getSignature
(boolean effective, boolean internal, boolean includeReturnType, boolean qualifiedNames) boolean
Rename this method.boolean
setParameterName
(int index, String name, boolean failOnNameConflict, boolean notify) Set a parameter name.Methods inherited from interface com.pnfsoftware.jeb.core.units.code.ICodeItem
getAddress, getAddress, getGenericFlags, getItemId, getName, getSignature, isArtificial, isInternal
Methods inherited from interface com.pnfsoftware.jeb.core.units.code.ICodeMethod
getInstructions
-
Method Details
-
getIndex
int getIndex()Get the index of this item in the Dex file's method list. -
getReturnType
IDexType getReturnType()Description copied from interface:ICodeMethod
Get the method's return type.- Specified by:
getReturnType
in interfaceICodeMethod
- Returns:
- the return type, null if unknown
-
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 interfaceICodeMethod
- 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 interfaceICodeMethod
- Returns:
- the class type, null if unknown
-
getClassTypeIndex
int getClassTypeIndex()Get the containing class type index.- Returns:
- the class type index
-
getClassTypeSignature
-
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
Get the name for this method. -
getSignature
Get the signature for this method.- Specified by:
getSignature
in interfaceICodeItem
- 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
Description copied from interface:ICodeItem
Get the item signature.- Specified by:
getSignature
in interfaceICodeItem
- 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
-
getSignature
String getSignature(boolean effective, boolean internal, boolean includeReturnType, boolean qualifiedNames) -
setName
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 aJ.UnitChange
notification.This method is for convenience only: users can always use the associated unit's
RENAME
action (through theexecuteAction
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
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
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 namefailOnNameConflict
- verify if the new name will not conflict with another parameter or variable name of this methodnotify
- true to notify listeners if the parameter name has effectively changed- Returns:
- change indicator
-