public interface

IDexClass

implements ICodeClass IDexItem
com.pnfsoftware.jeb.core.units.code.android.dex.IDexClass

Class Overview

This interface represents a Dex class_def_item object. All internal Dex types implement this interface, it is not limited to actual class types. Retrieved via getClasses().

Summary

[Expand]
Inherited Constants
From interface com.pnfsoftware.jeb.core.units.code.ICodeItem
Public Methods
abstract int getAccessFlags()
Get the access flags for the class.
abstract Map<String, IDexValue> getAnnotationDefaults()
A convenience method used to retrieve the list of annotation default values, if this type is an annotation type.
abstract IDexAnnotationsDirectory getAnnotationsDirectory()
Get the annotations directory of the class.
abstract int getClassTypeIndex()
Get the type index for this class object.
abstract IDexClassData getData()
Get the class data.
abstract IDexField getField(boolean effective, String name, String fieldtype)
Retrieve a field defined in this class.
abstract List<? extends IDexField> getFields()
Get the list of fields that are defined in this class (super fields are not returned).
abstract String[] getInterfaceSignatures(boolean effective)
Get the list of interfaces implemented by this class.
abstract int[] getInterfaceTypeIndexes()
Get the type indexes of the interfaces implemented by this class.
abstract IDexMethod getMethod(boolean effective, String name, String... parameterTypes)
Retrieve a method defined in this class.
abstract List<? extends IDexMethod> getMethods()
Get the list of methods that are defined in this class (super methods are not returned).
abstract int getSourceStringIndex()
Get the string index of the file name containing the original source for this class.
abstract List<? extends IDexValue> getStaticInitializers()
Get the static initializers of the class.
abstract int getSuperTypeIndex()
Get the type index for the superclass of this class.
abstract String getSupertypeSignature(boolean effective)
Get the superclass of that class.
abstract boolean isAnnotation()
Helper method to determine whether this type is an annotation.
abstract boolean isAnonymousClass()
This higher-level method indicates if this class was determined as an actual member (nested) class, specifically an anonymous member class.
abstract boolean isEnumeration()
Helper method to determine whether this type is an enumeration.
abstract boolean isInterface()
Helper method to determine whether this type is an interface.
abstract boolean isMemberClass()
This higher-level method indicates if this class is a member class (Dalvik terminology equivalent of Java's "nested" class), that is, a class defined within another class or method.
abstract boolean isNonStaticMemberClass()
This higher-level method indicates if this class was determined as an actual member (nested) class, specifically a non-static member class, i.e.
abstract boolean isStaticMemberClass()
This higher-level method indicates if this class was determined as an actual member (nested) class, specifically a static member class.
abstract boolean isSynthetic()
Helper method to determine whether this type is marked as synthetic, that is, auto-generated by a compiler.
abstract boolean isTrueClass()
Determine if a class is a 'true' class, meaning a class which is neither an interface nor an enumeration nor an annotation.
abstract boolean setName(String name)
Rename this class or type.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.units.code.ICodeClass
From interface com.pnfsoftware.jeb.core.units.code.ICodeItem
From interface com.pnfsoftware.jeb.core.units.code.android.dex.IDexItem

Public Methods

public abstract int getAccessFlags ()

Get the access flags for the class.

Returns
  • a combination of access flags defined in IDexUnit

public abstract Map<String, IDexValue> getAnnotationDefaults ()

A convenience method used to retrieve the list of annotation default values, if this type is an annotation type.

Returns
  • a map of default annotation values, possibly empty; this method returns null if this object does not represent an annotation type

public abstract IDexAnnotationsDirectory getAnnotationsDirectory ()

Get the annotations directory of the class. The directory contains annotations for the class, methods, fields and methods' parameters.

Returns
  • the annotations directory

public abstract int getClassTypeIndex ()

Get the type index for this class object.

Returns
  • the index

public abstract IDexClassData getData ()

Get the class data.

Returns
  • the class data reference, or null if there is no class data (eg, marker interface)

public abstract IDexField getField (boolean effective, String name, String fieldtype)

Retrieve a field defined in this class.

Parameters
effective the provided name and type are effective names, as opposed to original names
name field name
fieldtype field type (jvm notation)
Returns
  • a field or null if not found

public abstract List<? extends IDexField> getFields ()

Get the list of fields that are defined in this class (super fields are not returned).

Returns
  • a non-null list of fields

public abstract String[] getInterfaceSignatures (boolean effective)

Get the list of interfaces implemented by this class.

Returns
  • list of strings representing the FQ-classnames of the interfaces.

public abstract int[] getInterfaceTypeIndexes ()

Get the type indexes of the interfaces implemented by this class.

Returns
  • the type indexes

public abstract IDexMethod getMethod (boolean effective, String name, String... parameterTypes)

Retrieve a method defined in this class.

Parameters
effective the provided name and type signatures are effective names, as opposed to original names
name method name
parameterTypes method parameter types (jvm notation)
Returns
  • a method or null if not found

public abstract List<? extends IDexMethod> getMethods ()

Get the list of methods that are defined in this class (super methods are not returned).

Returns
  • a non-null list of methods

public abstract int getSourceStringIndex ()

Get the string index of the file name containing the original source for this class.

Note: This is a debug/metadata field and should be used with caution.

Returns
  • the string index, -1 if it is not set

public abstract List<? extends IDexValue> getStaticInitializers ()

Get the static initializers of the class.

Returns
  • the list of initial values for static fields

public abstract int getSuperTypeIndex ()

Get the type index for the superclass of this class.

Returns
  • the superclass type index, or -1 if none (ie, java.lang.Object)

public abstract String getSupertypeSignature (boolean effective)

Get the superclass of that class. At least java.lang.Object.

Returns
  • FQ-classname of the superclass

public abstract boolean isAnnotation ()

Helper method to determine whether this type is an annotation.

public abstract boolean isAnonymousClass ()

This higher-level method indicates if this class was determined as an actual member (nested) class, specifically an anonymous member class.

It may not reflect underlying metadata information (such as class annotations, etc.).

public abstract boolean isEnumeration ()

Helper method to determine whether this type is an enumeration.

public abstract boolean isInterface ()

Helper method to determine whether this type is an interface.

public abstract boolean isMemberClass ()

This higher-level method indicates if this class is a member class (Dalvik terminology equivalent of Java's "nested" class), that is, a class defined within another class or method. A member class can be static (nested inside a class), inner (non-static, nested inside a class), local (non-static, nested inside a method), or anonymous (always non-static, within a class or method). (Note that lambdas are not considered here: native lambdas are invoked using specific bytecode; desugared lambdas are implemented with standard member classes.)

This method does not necessarily reflect the underlying dex class data, in particular, the annotations metadata. If a publicized inner class is deemed improper, this method will return false regardless of what metadata say.

Returns
  • true if the class looks like a valid member class

public abstract boolean isNonStaticMemberClass ()

This higher-level method indicates if this class was determined as an actual member (nested) class, specifically a non-static member class, i.e. one of inner class, local class, or anonymous class.

It may not reflect underlying metadata information (such as class annotations, etc.).

public abstract boolean isStaticMemberClass ()

This higher-level method indicates if this class was determined as an actual member (nested) class, specifically a static member class.

It may not reflect underlying metadata information (such as class annotations, etc.).

public abstract boolean isSynthetic ()

Helper method to determine whether this type is marked as synthetic, that is, auto-generated by a compiler. This hint should not be trusted.

public abstract boolean isTrueClass ()

Determine if a class is a 'true' class, meaning a class which is neither an interface nor an enumeration nor an annotation.

public abstract boolean setName (String name)

Rename this class or type. 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