public interface

IDexMethod

implements ICodeMethod IDexItem
com.pnfsoftware.jeb.core.units.code.android.dex.IDexMethod

Class Overview

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.

Summary

[Expand]
Inherited Constants
From interface com.pnfsoftware.jeb.core.units.code.ICodeItem
Public Methods
abstract IDexType getClassType()
Get the type of the class holding this method.
abstract int getClassTypeIndex()
Get the containing class type index.
abstract String getClassTypeSignature(boolean effective)
abstract IDexMethodData getData()
Get a reference to the method definition, if the method is internal.
abstract SortedMap<Integer, List<IDexDebugVariable>> getDebugVariablesMap()
Retrieve a high-level map of variables defined in the debug information of this method.
abstract int getIndex()
Get the index of this item in the Dex file's method list.
abstract String getName(boolean effective)
Get the name for this method.
abstract int getNameIndex()
Get the method name index.
abstract String getParameterName(int index)
Set a parameter name.
abstract List<IDexType> getParameterTypes()
Retrieve the list of parameters.
abstract IDexPrototype getPrototype()
abstract int getPrototypeIndex()
Get the method prototype index.
abstract IDexType getReturnType()
Get the method's return type.
abstract String getSignature(boolean effective, boolean internal, boolean includeReturnType)
abstract String getSignature(boolean effective, boolean internal)
Get the item signature.
abstract String getSignature(boolean effective)
Get the signature for this method.
abstract String getSignature(boolean effective, boolean internal, boolean includeReturnType, boolean qualifiedNames)
abstract boolean setName(String name)
Rename this method.
abstract boolean setParameterName(int index, String name, boolean notify)
This method is deprecated. use setParameterName(int, String, boolean, boolean)
abstract boolean setParameterName(int index, String name, boolean failOnNameConflict, boolean notify)
Set a parameter name.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.units.code.ICodeItem
From interface com.pnfsoftware.jeb.core.units.code.ICodeMethod
From interface com.pnfsoftware.jeb.core.units.code.android.dex.IDexItem

Public Methods

public abstract IDexType getClassType ()

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).

Returns
  • the class type, null if unknown

public abstract int getClassTypeIndex ()

Get the containing class type index.

Returns
  • the class type index

public abstract String getClassTypeSignature (boolean effective)

public abstract IDexMethodData getData ()

Get a reference to the method definition, if the method is internal.

Returns
  • the methods data, null for external methods

public abstract 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

public abstract int getIndex ()

Get the index of this item in the Dex file's method list.

Returns
  • the method index

public abstract String getName (boolean effective)

Get the name for this method.

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

public abstract int getNameIndex ()

Get the method name index.

Returns
  • the name index

public abstract 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

public abstract 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.

Returns
  • the parameter types, null if unknown

public abstract IDexPrototype getPrototype ()

public abstract int getPrototypeIndex ()

Get the method prototype index.

Returns
  • the prototype index

public abstract IDexType getReturnType ()

Get the method's return type.

Returns
  • the return type, null if unknown

public abstract String getSignature (boolean effective, boolean internal, boolean includeReturnType)

public abstract String getSignature (boolean effective, boolean internal)

Get the item signature.

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

public abstract String getSignature (boolean effective)

Get the signature for this method.

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

public abstract String getSignature (boolean effective, boolean internal, boolean includeReturnType, boolean qualifiedNames)

public abstract 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 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

public abstract boolean setParameterName (int index, String name, boolean notify)

This method is deprecated.
use setParameterName(int, String, boolean, boolean)

public abstract 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