Interface IDexClass
- All Superinterfaces:
ICodeClass
,ICodeItem
,IDexItem
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
IDexUnit.getClasses()
.-
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 TypeMethodDescriptionint
Get the access flags for the class.A convenience method used to retrieve the list of annotation default values, if this type is an annotation type.Get the annotations directory of the class.int
Get the type index for this class object.getData()
Get the class data.int
Retrieve the index of the dex file that defines this class or interface.Retrieve a field defined in this class.Get the list of fields that are defined in this class (super fields are not returned).String[]
getInterfaceSignatures
(boolean effective) Get the list of interfaces implemented by this class.int[]
Get the type indexes of the interfaces implemented by this class.Retrieve a method defined in this class.List<? extends IDexMethod>
Get the list of methods that are defined in this class (super methods are not returned).int
Get the string index of the file name containing the original source for this class.Get the static initializers of the class.int
Get the type index for the superclass of this class.getSupertypeSignature
(boolean effective) Get the superclass of that class.boolean
Helper method to determine whether this type is an annotation.boolean
This higher-level method indicates if this class was determined as an actual member (nested) class, specifically an anonymous member class.boolean
Helper method to determine whether this type is an enumeration.boolean
Helper method to determine whether this type is an interface.boolean
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.boolean
This higher-level method indicates if this class was determined as an actual member (nested) class, specifically a non-static member class, i.e.boolean
This higher-level method indicates if this class was determined as an actual member (nested) class, specifically a static member class.boolean
Helper method to determine whether this type is marked as synthetic, that is, auto-generated by a compiler.boolean
Determine if a class is a 'true' class, meaning a class which is neither an interface nor an enumeration nor an annotation.boolean
Rename this class or type.Methods inherited from interface com.pnfsoftware.jeb.core.units.code.ICodeClass
getClassType, getImplementedInterfaces, getPackage, getSupertypes
Methods inherited from interface com.pnfsoftware.jeb.core.units.code.ICodeItem
getAddress, getAddress, getGenericFlags, getIndex, getItemId, getName, getName, getSignature, getSignature, getSignature, isArtificial, isInternal
-
Method Details
-
getClassTypeIndex
int getClassTypeIndex()Get the type index for this class object.- Returns:
- the index
-
getSuperTypeIndex
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)
-
getSupertypeSignature
Get the superclass of that class. At least java.lang.Object.- Returns:
- FQ-classname of the superclass
-
getInterfaceTypeIndexes
int[] getInterfaceTypeIndexes()Get the type indexes of the interfaces implemented by this class.- Returns:
- the type indexes
-
getInterfaceSignatures
Get the list of interfaces implemented by this class.- Returns:
- list of strings representing the FQ-classnames of the interfaces.
-
getAccessFlags
int getAccessFlags()Get the access flags for the class.- Returns:
- a combination of access flags defined in
IDexUnit
-
getSourceStringIndex
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
-
getFields
Description copied from interface:ICodeClass
Get the list of fields that are defined in this class (super fields are not returned).- Specified by:
getFields
in interfaceICodeClass
- Returns:
- a non-null list of fields
-
getMethods
List<? extends IDexMethod> getMethods()Description copied from interface:ICodeClass
Get the list of methods that are defined in this class (super methods are not returned).- Specified by:
getMethods
in interfaceICodeClass
- Returns:
- a non-null list of methods
-
getDexFileIndex
int getDexFileIndex()Retrieve the index of the dex file that defines this class or interface.- Returns:
- an index into
IDexUnit.getDexFiles()
(of the owner , or -1 if unknown or not defined
-
getData
IDexClassData getData()Get the class data.- Returns:
- the class data reference, or null if there is no class data (eg, marker interface)
-
getStaticInitializers
Get the static initializers of the class.- Returns:
- the list of initial values for static fields
-
getAnnotationsDirectory
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
-
setName
Rename this class or type. 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
-
isMemberClass
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 bestatic
(nested inside a class),inner
(non-static, nested inside a class),local
(non-static, nested inside a method), oranonymous
(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
-
isAnonymousClass
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.).
- Returns:
-
isNonStaticMemberClass
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.).
- Returns:
-
isStaticMemberClass
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.).
- Returns:
-
getMethod
Retrieve a method defined in this class.- Parameters:
effective
- the provided name and type signatures are effective names, as opposed to original namesname
- method nameparameterTypes
- method parameter types (jvm notation)- Returns:
- a method or null if not found
-
getField
Retrieve a field defined in this class.- Parameters:
effective
- the provided name and type are effective names, as opposed to original namesname
- field namefieldtype
- field type (jvm notation)- Returns:
- a field or null if not found
-
isTrueClass
boolean isTrueClass()Determine if a class is a 'true' class, meaning a class which is neither an interface nor an enumeration nor an annotation.- Returns:
-
isEnumeration
boolean isEnumeration()Helper method to determine whether this type is an enumeration.- Returns:
-
isInterface
boolean isInterface()Helper method to determine whether this type is an interface.- Returns:
-
isAnnotation
boolean isAnnotation()Helper method to determine whether this type is an annotation.- Returns:
-
isSynthetic
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.- Returns:
-
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
-