Package jadx.core.dex.nodes
Class MethodNode
java.lang.Object
jadx.core.dex.attributes.AttrNode
jadx.core.dex.attributes.nodes.LineAttrNode
jadx.core.dex.attributes.nodes.NotificationAttrNode
jadx.core.dex.nodes.MethodNode
- All Implemented Interfaces:
IRenameNode,ICodeAnnotation,ICodeNodeRef,IJadxAttribute,IAttributeNode,ILineAttributeNode,ICodeNode,IDexNode,ILoadable,IMethodDetails,IUsageInfoNode,Comparable<MethodNode>
public class MethodNode
extends NotificationAttrNode
implements IMethodDetails, ILoadable, ICodeNode, Comparable<MethodNode>
-
Nested Class Summary
Nested classes/interfaces inherited from interface jadx.api.metadata.ICodeAnnotation
ICodeAnnotation.AnnType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AccessInfoprivate List<RegisterArg> private intprivate intprivate booleanprivate final ICodeReaderprivate static final InsnNode[]private BlockNodeprivate List<ExceptionHandler> private BlockNodeprivate final intprivate @Nullable InsnNode[]private JavaMethodprivate booleanprivate static final org.slf4j.Loggerprivate Set<MethodNode> private final MethodInfoprivate booleanprivate final ClassNodeprivate Regionprivate intprivate ArgTypeprivate RegisterArgprivate List<MethodInfo> private List<MethodNode> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddExceptionHandler(ExceptionHandler handler) voidaddUsed(MethodNode used) static MethodNodebuild(ClassNode classNode, IMethodData methodData) booleanbooleanintcompareTo(@NotNull MethodNode o) booleanlongCalculate instructions count at current stagebooleanvoidgetAlias()getAllLoopsForBlock(BlockNode block) private intgetArgsStartPos(List<ArgType> args) int@Nullable ICodeReaderReturns method code with comments and annotations@Nullable IDebugInfointintRaw instructions count in method bytecodeInsnNode[]@Nullable LoopInfogetLoopForBlock(BlockNode block) getLoops()intlonggetName()intprivate intgetNextSVarVersion(int regNum) intint@NotNull ArgTypegetSVars()@Nullable RegisterArggetUsed()getUseIn()inthashCode()voidprivate voidinitArguments(List<ArgType> args) voidbooleanReturn true if exists method with same name and arguments countbooleanbooleanbooleanisLoaded()booleanisNoCode()booleanbooleanisPreExitBlock(BlockNode block) booleanisVarArg()booleanvoidload()On demand loadingmakeNewSVar(int regNum, int version, @NotNull RegisterArg assignArg) makeNewSVar(@NotNull RegisterArg assignArg) makeSyntheticRegArg(ArgType type) Create new fake register arg.makeSyntheticRegArg(ArgType type, String name) voidregisterLoop(LoopInfo loop) voidreload()private voidvoidremoveSVar(SSAVar var) voidvoidroot()voidsetAccessFlags(AccessInfo newAccessFlags) voidsetBasicBlocks(List<BlockNode> blocks) voidsetCallsSelf(boolean callsSelf) voidsetEnterBlock(BlockNode enterBlock) voidsetExitBlock(BlockNode exitBlock) voidsetJavaNode(JavaMethod javaNode) voidvoidsetUnresolvedUsed(List<MethodInfo> unresolvedUsed) voidsetUsed(List<MethodNode> methodsUsed) voidsetUseIn(List<MethodNode> useIn) voidtoString()typeName()voidunload()Free resourcesvoidvoidupdateArgTypes(List<ArgType> newArgTypes, String comment) voidvoidupdateReturnType(ArgType type) voidupdateTypeParameters(List<ArgType> typeParameters) voidupdateTypes(List<ArgType> argTypes, ArgType retType) 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, setDefPositionMethods inherited from interface jadx.api.plugins.input.data.attributes.IJadxAttribute
keepLoadedMethods inherited from interface jadx.core.dex.nodes.IMethodDetails
getAttrType
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
EMPTY_INSN_ARRAY
-
mthInfo
-
parentClass
-
accFlags
-
codeReader
-
insnsCount
private final int insnsCount -
noCode
private boolean noCode -
regsCount
private int regsCount -
argsStartReg
private int argsStartReg -
loaded
private boolean loaded -
retType
-
argTypes
-
typeParameters
-
thisArg
-
argsList
-
instructions
-
blocks
-
blocksMaxCId
private int blocksMaxCId -
enterBlock
-
exitBlock
-
sVars
-
exceptionHandlers
-
loops
-
region
-
useIn
-
unresolvedUsed
-
methodsUsed
-
callsSelf
private boolean callsSelf -
javaNode
-
-
Constructor Details
-
MethodNode
-
-
Method Details
-
build
-
unload
public void unload()Description copied from interface:ILoadableFree resources -
updateTypes
-
updateTypeParameters
-
load
Description copied from interface:ILoadableOn demand loading- Specified by:
loadin interfaceILoadable- Throws:
DecodeException
-
reload
public void reload() -
initArguments
-
getArgsStartPos
-
getArgTypes
- Specified by:
getArgTypesin interfaceIMethodDetails
-
updateArgTypes
-
containsGenericArgs
public boolean containsGenericArgs() -
getReturnType
- Specified by:
getReturnTypein interfaceIMethodDetails
-
updateReturnType
-
isVoidReturn
public boolean isVoidReturn() -
collectArgNodes
-
getArgRegs
-
getAllArgRegs
-
getThisArg
-
skipFirstArgument
public void skipFirstArgument() -
getTypeParameters
- Specified by:
getTypeParametersin interfaceIMethodDetails
-
getName
-
getAlias
-
getDeclaringClass
- Specified by:
getDeclaringClassin interfaceICodeNode
-
getParentClass
-
getTopParentClass
-
isNoCode
public boolean isNoCode() -
getInstructions
-
unloadInsnArr
public void unloadInsnArr() -
initBasicBlocks
public void initBasicBlocks() -
finishBasicBlocks
public void finishBasicBlocks() -
getBasicBlocks
-
setBasicBlocks
-
updateBlockPositions
public void updateBlockPositions() -
getNextBlockCId
public int getNextBlockCId() -
getEnterBlock
-
setEnterBlock
-
getExitBlock
-
setExitBlock
-
getPreExitBlocks
-
isPreExitBlock
-
resetLoops
public void resetLoops() -
registerLoop
-
getLoopForBlock
-
getAllLoopsForBlock
-
getLoopsCount
public int getLoopsCount() -
getLoops
-
addExceptionHandler
-
clearExceptionHandlers
public boolean clearExceptionHandlers() -
getExceptionHandlers
-
isNoExceptionHandlers
public boolean isNoExceptionHandlers() -
getExceptionHandlersCount
public int getExceptionHandlersCount() -
getThrows
- Specified by:
getThrowsin interfaceIMethodDetails
-
isArgsOverloaded
public boolean isArgsOverloaded()Return true if exists method with same name and arguments count -
isConstructor
public boolean isConstructor() -
isDefaultConstructor
public boolean isDefaultConstructor() -
getRegsCount
public int getRegsCount() -
getArgsStartReg
public int getArgsStartReg() -
makeSyntheticRegArg
Create new fake register arg. -
makeSyntheticRegArg
-
makeNewSVar
-
makeNewSVar
-
getNextSVarVersion
private int getNextSVarVersion(int regNum) -
removeSVar
-
getSVars
-
getRawAccessFlags
public int getRawAccessFlags()- Specified by:
getRawAccessFlagsin interfaceIMethodDetails
-
getAccessFlags
- Specified by:
getAccessFlagsin interfaceICodeNode
-
setAccessFlags
- Specified by:
setAccessFlagsin interfaceICodeNode
-
getRegion
-
setRegion
-
root
-
typeName
-
getInputFileName
- Specified by:
getInputFileNamein interfaceIDexNode
-
getMethodInfo
- Specified by:
getMethodInfoin interfaceIMethodDetails
-
getMethodCodeOffset
public long getMethodCodeOffset() -
getDebugInfo
-
ignoreMethod
public void ignoreMethod() -
rename
- Specified by:
renamein interfaceIRenameNode
-
countInsns
public long countInsns()Calculate instructions count at current stage -
getInsnsCount
public int getInsnsCount()Raw instructions count in method bytecode -
getCodeStr
Returns method code with comments and annotations -
isVarArg
public boolean isVarArg()- Specified by:
isVarArgin interfaceIMethodDetails
-
isLoaded
public boolean isLoaded() -
getCodeReader
-
getUseIn
- Specified by:
getUseInin interfaceIUsageInfoNode
-
setUseIn
-
addUsed
-
setUsed
-
getUsed
-
getUnresolvedUsed
-
setUnresolvedUsed
-
setCallsSelf
public void setCallsSelf(boolean callsSelf) -
callsSelf
public boolean callsSelf() -
removeInvalidMethodsUsed
private void removeInvalidMethodsUsed() -
getJavaNode
-
setJavaNode
-
getAnnType
- Specified by:
getAnnTypein interfaceICodeAnnotation
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<MethodNode>
-
toAttrString
- Specified by:
toAttrStringin interfaceIJadxAttribute- Specified by:
toAttrStringin interfaceIMethodDetails
-
toString
-