Package jadx.core.dex.nodes
Class InsnNode
java.lang.Object
jadx.core.dex.attributes.AttrNode
jadx.core.dex.attributes.nodes.LineAttrNode
jadx.core.dex.nodes.InsnNode
- All Implemented Interfaces:
IAttributeNode,ILineAttributeNode
- Direct Known Subclasses:
ArithNode,BaseInvokeNode,ConstClassNode,ConstStringNode,FillArrayData,FillArrayInsn,FilledNewArrayNode,IndexInsnNode,NewArrayNode,PhiInsn,SwitchData,TargetInsnNode,TernaryInsn
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidprotected voidprotected voidprotected voidprotected booleanAppend arguments type, wrap line if too longprotected voidprotected voidprotected Stringprotected StringbooleanbooleanbooleanbooleancontainsArg(InsnArg arg) booleancontainsVar(RegisterArg arg) booleancopy()Make copy of InsnNode object.copy(RegisterArg newReturnArg) Seecopy()voidcopyAttributesFrom(InsnNode attrNode) protected final <T extends InsnNode>
TcopyCommonParams(T copy) Seecopy()<T extends InsnNode>
TSeecopy()static <T extends InsnArg>
TduplicateArg(T arg) final booleanCompare instruction only by identity.getArg(int n) intgetArgIndex(InsnArg arg) intintvoidgetRegisterArgs(Collection<RegisterArg> collection) getType()final inthashCode()Compare instruction only by identity.voidinheritMetadata(InsnNode sourceInsn) booleanbooleanisDeepEquals(InsnNode other) 'Hard' equals, compare all argumentsbooleanboolean'Soft' equals, don't compare arguments, only instruction specific parameters.voidFix SSAVar info in register arguments.removeArg(int index) protected booleanbooleanreplaceArg(InsnArg from, InsnArg to) Replace instruction arg with another using recursive search.voidvoidsetOffset(int offset) voidsetResult(@Nullable RegisterArg res) toString()voidVisit all args recursively (including inner instructions), but excluding wrapped args<R> RVisit all args recursively (including inner instructions), but excluding wrapped args.voidvisitInsns(Consumer<InsnNode> visitor) Visit this instruction and all inner (wrapped) instructions<R> RvisitInsns(Function<InsnNode, R> visitor) Visit this instruction and all inner (wrapped) instructions To terminate visiting return non-null valuestatic InsnNodeMethods 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, unloadAttributes
-
Field Details
-
insnType
-
result
-
arguments
-
offset
protected int offset
-
-
Constructor Details
-
InsnNode
-
InsnNode
-
-
Method Details
-
wrapArg
-
setResult
-
addArg
-
setArg
-
attachArg
-
getType
-
getResult
-
getArguments
-
getArgList
-
getArgsCount
public int getArgsCount() -
getArg
-
containsArg
-
containsVar
-
replaceArg
Replace instruction arg with another using recursive search. -
removeArg
-
removeArg
-
getArgIndex
-
addReg
-
addReg
-
addLit
-
addLit
-
getOffset
public int getOffset() -
setOffset
public void setOffset(int offset) -
getRegisterArgs
-
isConstInsn
public boolean isConstInsn() -
isExitEdgeInsn
public boolean isExitEdgeInsn() -
canRemoveResult
public boolean canRemoveResult() -
canReorder
public boolean canReorder() -
containsWrappedInsn
public boolean containsWrappedInsn() -
visitInsns
Visit this instruction and all inner (wrapped) instructions -
visitInsns
Visit this instruction and all inner (wrapped) instructions To terminate visiting return non-null value -
visitArgs
Visit all args recursively (including inner instructions), but excluding wrapped args -
visitArgs
Visit all args recursively (including inner instructions), but excluding wrapped args. To terminate visiting return non-null value -
isSame
'Soft' equals, don't compare arguments, only instruction specific parameters. -
isDeepEquals
'Hard' equals, compare all arguments -
duplicateArg
-
copyCommonParams
-
copyAttributesFrom
-
copy
Make copy of InsnNode object.
NOTE: can't copy instruction with result argument (SSA variable can't be used in two different assigns).
Prefer use next methods:copyWithoutResult()to explicitly state that result not neededcopy(RegisterArg)to provide new result argcopyWithNewSsaVar(MethodNode)to make new SSA variable for result arg
-
copyWithoutResult
Seecopy() -
copyWithoutSsa
-
copy
Seecopy() -
copyWithNewSsaVar
Seecopy() -
rebindArgs
public void rebindArgs()Fix SSAVar info in register arguments. Must be used after altering instructions. -
canThrowException
public boolean canThrowException() -
inheritMetadata
-
hashCode
public final int hashCode()Compare instruction only by identity. -
equals
Compare instruction only by identity. -
appendArgs
Append arguments type, wrap line if too long- Returns:
- true if args wrapped
-
attributesString
-
appendAttributes
-
baseString
-
toString
-