Package jadx.core.utils
Class InsnUtils
java.lang.Object
jadx.core.utils.InsnUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable InsnNodecheckInsnType(@Nullable InsnNode insn, InsnType insnType) static booleanstatic booleancontainsVar(InsnArg insnArg, RegisterArg arg) static booleancontainsVar(InsnNode insn, RegisterArg arg) static <T extends InsnArg>
booleancontainsVar(List<T> list, RegisterArg arg) static booleanstatic StringformatOffset(int offset) static ObjectgetConstValueByArg(RootNode root, InsnArg arg) Search constant assigned to provided arg.static @Nullable ObjectgetConstValueByInsn(RootNode root, InsnNode insn) Return constant value from insn or null if not constant.static @Nullable RegisterArggetRegFromInsn(List<RegisterArg> regs, InsnType insnType) static @Nullable InsnArggetSingleArg(InsnNode insn) static @Nullable InsnNodegetWrappedInsn(InsnArg arg) static StringindexToString(Object index) static StringinsnTypeToString(InsnType type) static booleanisInsnType(@Nullable InsnNode insn, InsnType insnType) static booleanprivate static InsnNoderecursiveInsnCheck(InsnNode insn, InsnType insnType, Predicate<InsnNode> test) static voidreplaceInsns(MethodNode mth, Function<InsnNode, InsnNode> replaceFunction) static voidreplaceInsnsInInsn(MethodNode mth, InsnNode insn, Function<InsnNode, InsnNode> replaceFunction) static @Nullable InsnNodesearchInsn(MethodNode mth, InsnType insnType, Predicate<InsnNode> test) Search instruction of specific type and condition in method.static @Nullable InsnNodesearchSingleReturnInsn(MethodNode mth, Predicate<InsnNode> test)
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG
-
-
Constructor Details
-
InsnUtils
private InsnUtils()
-
-
Method Details
-
formatOffset
-
insnTypeToString
-
indexToString
-
getConstValueByArg
Search constant assigned to provided arg.- Returns:
- LiteralArg, String, ArgType or null
-
getConstValueByInsn
Return constant value from insn or null if not constant.- Returns:
- LiteralArg, String, ArgType or null
-
searchSingleReturnInsn
@Nullable public static @Nullable InsnNode searchSingleReturnInsn(MethodNode mth, Predicate<InsnNode> test) -
searchInsn
@Nullable public static @Nullable InsnNode searchInsn(MethodNode mth, InsnType insnType, Predicate<InsnNode> test) Search instruction of specific type and condition in method. This method support inlined instructions. -
replaceInsns
-
replaceInsnsInInsn
public static void replaceInsnsInInsn(MethodNode mth, InsnNode insn, Function<InsnNode, InsnNode> replaceFunction) -
getRegFromInsn
@Nullable public static @Nullable RegisterArg getRegFromInsn(List<RegisterArg> regs, InsnType insnType) -
recursiveInsnCheck
-
getSingleArg
-
checkInsnType
-
isInsnType
-
getWrappedInsn
-
isWrapped
-
dontGenerateIfNotUsed
-
containsVar
-
containsVar
-
containsVar
-
contains
-