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,jadx.api.plugins.input.data.attributes.IJadxAttribute,IAttributeNode,ILineAttributeNode,ICodeNode,IDexNode,ILoadable,IMethodDetails,IUsageInfoNode,java.lang.Comparable<MethodNode>
public class MethodNode extends NotificationAttrNode implements IMethodDetails, ILoadable, ICodeNode, java.lang.Comparable<MethodNode>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jadx.api.metadata.ICodeAnnotation
ICodeAnnotation.AnnType
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ExceptionHandleraddExceptionHandler(ExceptionHandler handler)static MethodNodebuild(ClassNode classNode, jadx.api.plugins.input.data.IMethodData methodData)booleanclearExceptionHandlers()java.util.List<VarNode>collectArgNodes()intcompareTo(@NotNull MethodNode o)booleancontainsGenericArgs()longcountInsns()Calculate instructions count at current stagebooleanequals(java.lang.Object obj)voidfinishBasicBlocks()AccessInfogetAccessFlags()java.lang.StringgetAlias()java.util.List<RegisterArg>getAllArgRegs()java.util.List<LoopInfo>getAllLoopsForBlock(BlockNode block)ICodeAnnotation.AnnTypegetAnnType()java.util.List<RegisterArg>getArgRegs()intgetArgsStartReg()@NotNull java.util.List<ArgType>getArgTypes()java.util.List<BlockNode>getBasicBlocks()@Nullable jadx.api.plugins.input.data.ICodeReadergetCodeReader()java.lang.StringgetCodeStr()Returns method code with comments and annotations@Nullable jadx.api.plugins.input.data.IDebugInfogetDebugInfo()ClassNodegetDeclaringClass()BlockNodegetEnterBlock()java.lang.Iterable<ExceptionHandler>getExceptionHandlers()intgetExceptionHandlersCount()BlockNodegetExitBlock()java.lang.StringgetInputFileName()intgetInsnsCount()Raw instructions count in method bytecodeInsnNode[]getInstructions()JavaMethodgetJavaNode()@Nullable LoopInfogetLoopForBlock(BlockNode block)java.lang.Iterable<LoopInfo>getLoops()intgetLoopsCount()longgetMethodCodeOffset()MethodInfogetMethodInfo()java.lang.StringgetName()intgetNextBlockCId()ClassNodegetParentClass()java.util.List<BlockNode>getPreExitBlocks()intgetRawAccessFlags()RegiongetRegion()intgetRegsCount()@NotNull ArgTypegetReturnType()java.util.List<SSAVar>getSVars()@Nullable RegisterArggetThisArg()java.util.List<ArgType>getThrows()ClassNodegetTopParentClass()java.util.List<ArgType>getTypeParameters()java.util.List<MethodNode>getUseIn()inthashCode()voidignoreMethod()voidinitBasicBlocks()booleanisArgsOverloaded()Return true if exists method with same name and arguments countbooleanisConstructor()booleanisDefaultConstructor()booleanisLoaded()booleanisNoCode()booleanisNoExceptionHandlers()booleanisPreExitBlock(BlockNode block)booleanisVarArg()booleanisVoidReturn()voidload()On demand loadingSSAVarmakeNewSVar(int regNum, int version, @NotNull RegisterArg assignArg)SSAVarmakeNewSVar(@NotNull RegisterArg assignArg)RegisterArgmakeSyntheticRegArg(ArgType type)Create new fake register arg.RegisterArgmakeSyntheticRegArg(ArgType type, java.lang.String name)voidregisterLoop(LoopInfo loop)voidreload()voidremoveSVar(SSAVar var)voidrename(java.lang.String newName)voidresetLoops()RootNoderoot()voidsetAccessFlags(AccessInfo newAccessFlags)voidsetBasicBlocks(java.util.List<BlockNode> blocks)voidsetEnterBlock(BlockNode enterBlock)voidsetExitBlock(BlockNode exitBlock)voidsetJavaNode(JavaMethod javaNode)voidsetRegion(Region region)voidsetUseIn(java.util.List<MethodNode> useIn)voidskipFirstArgument()java.lang.StringtoAttrString()java.lang.StringtoString()java.lang.StringtypeName()voidunload()Free resourcesvoidunloadInsnArr()voidupdateArgTypes(java.util.List<ArgType> newArgTypes, java.lang.String comment)voidupdateBlockPositions()voidupdateReturnType(ArgType type)voidupdateTypeParameters(java.util.List<ArgType> typeParameters)voidupdateTypes(java.util.List<ArgType> argTypes, ArgType retType)-
Methods inherited from class jadx.core.dex.attributes.nodes.NotificationAttrNode
addCodeComment, addCodeComment, addDebugComment, addError, addInfoComment, addWarn, addWarnComment, addWarnComment, checkCommentsLevel, getCommentsLevel
-
Methods inherited from class jadx.core.dex.attributes.nodes.LineAttrNode
addSourceLineFrom, copyLines, getDefPosition, getSourceLine, setDefPosition, setSourceLine
-
Methods 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, unloadAttributes
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods 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, rewriteAttributeFrom
-
Methods inherited from interface jadx.api.metadata.ICodeNodeRef
getDefPosition, setDefPosition
-
Methods inherited from interface jadx.core.dex.nodes.IMethodDetails
getAttrType
-
-
-
-
Method Detail
-
build
public static MethodNode build(ClassNode classNode, jadx.api.plugins.input.data.IMethodData methodData)
-
unload
public void unload()
Description copied from interface:ILoadableFree resources
-
updateTypeParameters
public void updateTypeParameters(java.util.List<ArgType> typeParameters)
-
load
public void load() throws DecodeExceptionDescription copied from interface:ILoadableOn demand loading- Specified by:
loadin interfaceILoadable- Throws:
DecodeException
-
reload
public void reload()
-
getArgTypes
@NotNull public @NotNull java.util.List<ArgType> getArgTypes()
- Specified by:
getArgTypesin interfaceIMethodDetails
-
updateArgTypes
public void updateArgTypes(java.util.List<ArgType> newArgTypes, java.lang.String comment)
-
containsGenericArgs
public boolean containsGenericArgs()
-
getReturnType
@NotNull public @NotNull ArgType getReturnType()
- Specified by:
getReturnTypein interfaceIMethodDetails
-
updateReturnType
public void updateReturnType(ArgType type)
-
isVoidReturn
public boolean isVoidReturn()
-
collectArgNodes
public java.util.List<VarNode> collectArgNodes()
-
getArgRegs
public java.util.List<RegisterArg> getArgRegs()
-
getAllArgRegs
public java.util.List<RegisterArg> getAllArgRegs()
-
getThisArg
@Nullable public @Nullable RegisterArg getThisArg()
-
skipFirstArgument
public void skipFirstArgument()
-
getTypeParameters
public java.util.List<ArgType> getTypeParameters()
- Specified by:
getTypeParametersin interfaceIMethodDetails
-
getName
public java.lang.String getName()
-
getAlias
public java.lang.String getAlias()
-
getDeclaringClass
public ClassNode getDeclaringClass()
- Specified by:
getDeclaringClassin interfaceICodeNode
-
getParentClass
public ClassNode getParentClass()
-
getTopParentClass
public ClassNode getTopParentClass()
-
isNoCode
public boolean isNoCode()
-
getInstructions
public InsnNode[] getInstructions()
-
unloadInsnArr
public void unloadInsnArr()
-
initBasicBlocks
public void initBasicBlocks()
-
finishBasicBlocks
public void finishBasicBlocks()
-
getBasicBlocks
public java.util.List<BlockNode> getBasicBlocks()
-
setBasicBlocks
public void setBasicBlocks(java.util.List<BlockNode> blocks)
-
updateBlockPositions
public void updateBlockPositions()
-
getNextBlockCId
public int getNextBlockCId()
-
getEnterBlock
public BlockNode getEnterBlock()
-
setEnterBlock
public void setEnterBlock(BlockNode enterBlock)
-
getExitBlock
public BlockNode getExitBlock()
-
setExitBlock
public void setExitBlock(BlockNode exitBlock)
-
getPreExitBlocks
public java.util.List<BlockNode> getPreExitBlocks()
-
isPreExitBlock
public boolean isPreExitBlock(BlockNode block)
-
resetLoops
public void resetLoops()
-
registerLoop
public void registerLoop(LoopInfo loop)
-
getLoopsCount
public int getLoopsCount()
-
getLoops
public java.lang.Iterable<LoopInfo> getLoops()
-
addExceptionHandler
public ExceptionHandler addExceptionHandler(ExceptionHandler handler)
-
clearExceptionHandlers
public boolean clearExceptionHandlers()
-
getExceptionHandlers
public java.lang.Iterable<ExceptionHandler> getExceptionHandlers()
-
isNoExceptionHandlers
public boolean isNoExceptionHandlers()
-
getExceptionHandlersCount
public int getExceptionHandlersCount()
-
getThrows
public java.util.List<ArgType> 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
public RegisterArg makeSyntheticRegArg(ArgType type)
Create new fake register arg.
-
makeSyntheticRegArg
public RegisterArg makeSyntheticRegArg(ArgType type, java.lang.String name)
-
makeNewSVar
public SSAVar makeNewSVar(@NotNull @NotNull RegisterArg assignArg)
-
makeNewSVar
public SSAVar makeNewSVar(int regNum, int version, @NotNull @NotNull RegisterArg assignArg)
-
removeSVar
public void removeSVar(SSAVar var)
-
getSVars
public java.util.List<SSAVar> getSVars()
-
getRawAccessFlags
public int getRawAccessFlags()
- Specified by:
getRawAccessFlagsin interfaceIMethodDetails
-
getAccessFlags
public AccessInfo getAccessFlags()
- Specified by:
getAccessFlagsin interfaceICodeNode
-
setAccessFlags
public void setAccessFlags(AccessInfo newAccessFlags)
- Specified by:
setAccessFlagsin interfaceICodeNode
-
getRegion
public Region getRegion()
-
setRegion
public void setRegion(Region region)
-
getInputFileName
public java.lang.String getInputFileName()
- Specified by:
getInputFileNamein interfaceIDexNode
-
getMethodInfo
public MethodInfo getMethodInfo()
- Specified by:
getMethodInfoin interfaceIMethodDetails
-
getMethodCodeOffset
public long getMethodCodeOffset()
-
getDebugInfo
@Nullable public @Nullable jadx.api.plugins.input.data.IDebugInfo getDebugInfo()
-
ignoreMethod
public void ignoreMethod()
-
rename
public void rename(java.lang.String newName)
- 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
public java.lang.String getCodeStr()
Returns method code with comments and annotations
-
isVarArg
public boolean isVarArg()
- Specified by:
isVarArgin interfaceIMethodDetails
-
isLoaded
public boolean isLoaded()
-
getCodeReader
@Nullable public @Nullable jadx.api.plugins.input.data.ICodeReader getCodeReader()
-
getUseIn
public java.util.List<MethodNode> getUseIn()
- Specified by:
getUseInin interfaceIUsageInfoNode
-
setUseIn
public void setUseIn(java.util.List<MethodNode> useIn)
-
getJavaNode
public JavaMethod getJavaNode()
-
setJavaNode
@Internal public void setJavaNode(JavaMethod javaNode)
-
getAnnType
public ICodeAnnotation.AnnType getAnnType()
- Specified by:
getAnnTypein interfaceICodeAnnotation
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
compareTo
public int compareTo(@NotNull @NotNull MethodNode o)- Specified by:
compareToin interfacejava.lang.Comparable<MethodNode>
-
toAttrString
public java.lang.String toAttrString()
- Specified by:
toAttrStringin interfacejadx.api.plugins.input.data.attributes.IJadxAttribute- Specified by:
toAttrStringin interfaceIMethodDetails
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-