Package jadx.core.dex.nodes
Class ClassNode
java.lang.Object
jadx.core.dex.attributes.AttrNode
jadx.core.dex.attributes.nodes.LineAttrNode
jadx.core.dex.attributes.nodes.NotificationAttrNode
jadx.core.dex.nodes.ClassNode
- All Implemented Interfaces:
IRenameNode,ICodeAnnotation,ICodeNodeRef,IAttributeNode,ILineAttributeNode,ICodeNode,IDexNode,ILoadable,IPackageUpdate,IUsageInfoNode,Comparable<ClassNode>
public class ClassNode
extends NotificationAttrNode
implements ILoadable, ICodeNode, IPackageUpdate, Comparable<ClassNode>
-
Nested Class Summary
Nested classes/interfaces inherited from interface jadx.api.metadata.ICodeAnnotation
ICodeAnnotation.AnnType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AccessInfoprivate final IClassDataprivate final ClassInfoTop level classes needed for code generation stageprivate static final ObjectTop level classes used in this class (only for top level classes, empty for inners)private Stringprivate JavaClassprivate LoadStageprivate static final org.slf4j.Loggerprivate List<MethodNode> private Map<MethodInfo, MethodNode> private PackageNodeprivate ClassNodeprivate final RootNodeprivate Stringprivate ProcessStateprivate ArgTypeClasses which uses this classprivate List<MethodNode> Methods which uses this class (by instructions only, definition is excluded) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCodegenDep(ClassNode dep) voidvoidaddInlinedClass(ClassNode cls) voidaddInnerClass(ClassNode cls) static ClassNodeaddSyntheticClass(RootNode root, ClassInfo clsInfo, int accessFlags) static ClassNodeaddSyntheticClass(RootNode root, String name, int accessFlags) private voidprivate booleanchangeClassNodePackage(String fullPkg) booleanprivate booleanprivate ArgTypecheckSuperType(IClassData cls) intprivate ICodeInfodecompile(boolean searchInCache) WARNING: Slow operation! Use with caution!voidvoidbooleanprivate ICodeInfoprivate intgetAccessFlags(IClassData cls) getAlias()Internal class info (don't use in code generation and external api).@Nullable MethodNode@Nullable IClassDataLow level class data access.getCode()@Nullable ICodeInfo@Nullable IFieldInfoRefgetConstField(Object obj) @Nullable IFieldInfoRefgetConstField(Object obj, boolean searchGlobal) @Nullable IFieldInfoRef@Nullable MethodNodeprotected voidvoidgetInnerAndInlinedClassesRecursive(Set<ClassNode> resultClassesSet) Get all inner and inlined classes recursivelyvoidgetInnerClassesRecursive(Set<ClassNode> resultClassesSet) getName()Deprecated.getState()@Nullable ArgTypeintgetType()getUseIn()inthashCode()booleanprivate voidinitStaticValues(List<FieldNode> fields) booleanbooleanisEnum()booleanisInner()booleanbooleanvoidload()On demand loadingprivate voidload(IClassData cls, boolean reloading) voidnotInner()voidonParentPackageUpdate(PackageNode updatedPkg) private static voidprivate static voidprocessDefinitionAnnotations(ICodeInfo codeInfo) Save node definition positions found in codeprivate static voidvoidvoidvoidvoidChange class name and package (if full name provided) Leading dot can be used to move to default package.private voidroot()searchField(FieldInfo field) searchFieldByName(String name) searchFieldByShortId(String shortId) searchMethod(MethodInfo mth) searchMethodByShortId(String shortId) @Nullable MethodNodeReturn first method by original short name Note: methods are not unique by name (class can have several methods with same name but different signature)voidsetAccessFlags(AccessInfo accessFlags) voidsetCodegenDeps(List<ClassNode> codegenDeps) voidsetDependencies(List<ClassNode> dependencies) voidsetInputFileName(String inputFileName) voidsetJavaNode(JavaClass javaNode) voidsetLoadStage(LoadStage loadStage) voidsetState(ProcessState state) voidvoidsetUseInMth(List<MethodNode> useInMth) toString()typeName()voidunload()Free resourcesvoidvoidvoidvoidvisitParentClasses(Consumer<ClassNode> consumer) voidvisitSuperTypes(BiConsumer<ArgType, ArgType> consumer) Methods inherited from class jadx.core.dex.attributes.nodes.NotificationAttrNode
addCodeComment, addCodeComment, addDebugComment, addError, addInfoComment, addWarn, addWarnComment, addWarnComment, checkCommentsLevel, getCommentsLevelMethods inherited from class jadx.core.dex.attributes.nodes.LineAttrNode
addSourceLineFrom, copyLines, getDefPosition, getSourceLine, setDefPosition, setSourceLineMethods inherited from class jadx.core.dex.attributes.AttrNode
add, addAttr, addAttr, addAttr, addAttrs, clearAttributes, contains, contains, copyAttributeFrom, copyAttributesFrom, get, getAll, getAnnotation, getAttributesString, getAttributesStringsList, isAttrStorageEmpty, remove, remove, removeAttr, rewriteAttributeFrom, unloadAttributesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jadx.core.dex.attributes.IAttributeNode
add, addAttr, addAttr, addAttrs, clearAttributes, contains, contains, copyAttributeFrom, copyAttributesFrom, get, getAll, getAnnotation, getAttributesString, getAttributesStringsList, isAttrStorageEmpty, remove, remove, removeAttr, rewriteAttributeFromMethods inherited from interface jadx.api.metadata.ICodeNodeRef
getDefPosition, setDefPosition
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
root
-
clsData
-
clsInfo
-
packageNode
-
accessFlags
-
superClass
-
interfaces
-
generics
-
inputFileName
-
methods
-
fields
-
innerClasses
-
inlinedClasses
-
smali
-
parentClass
-
state
-
loadStage
-
dependencies
Top level classes used in this class (only for top level classes, empty for inners) -
codegenDeps
Top level classes needed for code generation stage -
useIn
Classes which uses this class -
useInMth
Methods which uses this class (by instructions only, definition is excluded) -
mthInfoMap
-
javaNode
-
DECOMPILE_WITH_MODE_SYNC
-
-
Constructor Details
-
ClassNode
-
ClassNode
-
-
Method Details
-
load
-
restoreUsageData
private void restoreUsageData() -
checkSuperType
-
updateGenericClsData
-
processSpecialClasses
-
processAttributes
-
getAccessFlags
-
addSyntheticClass
-
addSyntheticClass
-
initStaticValues
-
checkSourceFilenameAttr
private boolean checkSourceFilenameAttr() -
checkProcessed
public boolean checkProcessed() -
ensureProcessed
public void ensureProcessed() -
decompile
-
decompileWithMode
WARNING: Slow operation! Use with caution! -
getCode
-
reloadCode
-
unloadCode
public void unloadCode() -
deepUnload
public void deepUnload() -
unloadFromCache
public void unloadFromCache() -
decompile
-
generateClassCode
-
processDefinitionAnnotations
Save node definition positions found in code -
getCodeFromCache
-
load
public void load()Description copied from interface:ILoadableOn demand loading -
unload
public void unload()Description copied from interface:ILoadableFree resources -
buildCache
private void buildCache() -
getSuperClass
-
getInterfaces
-
getGenericTypeParameters
-
getType
-
getMethods
-
getFields
-
addField
-
getConstField
-
getConstField
-
getConstFieldByLiteralArg
-
searchField
-
searchFieldByNameAndType
-
searchFieldByName
-
searchFieldByShortId
-
searchMethod
-
searchMethodByShortId
-
searchMethodByShortName
Return first method by original short name Note: methods are not unique by name (class can have several methods with same name but different signature) -
getDeclaringClass
- Specified by:
getDeclaringClassin interfaceICodeNode
-
getParentClass
-
notInner
public void notInner() -
rename
Change class name and package (if full name provided) Leading dot can be used to move to default package. Package for inner classes can't be changed.- Specified by:
renamein interfaceIRenameNode
-
changeClassNodePackage
-
removeAlias
public void removeAlias() -
onParentPackageUpdate
- Specified by:
onParentPackageUpdatein interfaceIPackageUpdate
-
getPackageNode
-
getTopParentClass
-
visitParentClasses
-
visitSuperTypes
-
hasNotGeneratedParent
public boolean hasNotGeneratedParent() -
getInnerClasses
-
getInlinedClasses
-
getInnerAndInlinedClassesRecursive
Get all inner and inlined classes recursively- Parameters:
resultClassesSet- all identified inner and inlined classes are added to this set
-
getInnerClassesRecursive
-
addInnerClass
-
addInlinedClass
-
isEnum
public boolean isEnum() -
isAnonymous
public boolean isAnonymous() -
isSynthetic
public boolean isSynthetic() -
isInner
public boolean isInner() -
isTopClass
public boolean isTopClass() -
getClassInitMth
-
getDefaultConstructor
-
getAccessFlags
- Specified by:
getAccessFlagsin interfaceICodeNode
-
setAccessFlags
- Specified by:
setAccessFlagsin interfaceICodeNode
-
root
-
typeName
-
getRawName
-
getClassInfo
Internal class info (don't use in code generation and external api). -
getName
-
getAlias
-
getShortName
Deprecated.Deprecated. UsegetAlias() -
getFullName
-
getPackage
-
getDisassembledCode
-
getDisassembledCode
-
getClsData
Low level class data access.- Returns:
- null for classes generated by jadx
-
getState
-
setState
-
getLoadStage
-
setLoadStage
-
reloadAtCodegenStage
public void reloadAtCodegenStage() -
getDependencies
-
setDependencies
-
removeDependency
-
getCodegenDeps
-
setCodegenDeps
-
addCodegenDep
-
getTotalDepsCount
public int getTotalDepsCount() -
getUseIn
- Specified by:
getUseInin interfaceIUsageInfoNode
-
setUseIn
-
getUseInMth
-
setUseInMth
-
getInputFileName
- Specified by:
getInputFileNamein interfaceIDexNode
-
setInputFileName
-
getJavaNode
-
setJavaNode
-
getAnnType
- Specified by:
getAnnTypein interfaceICodeAnnotation
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<ClassNode>
-
toString
-