Package jadx.core.utils
Class InsnUtils
- java.lang.Object
-
- jadx.core.utils.InsnUtils
-
public class InsnUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @Nullable InsnNodecheckInsnType(@Nullable InsnNode insn, InsnType insnType)static booleancontains(InsnNode insn, AFlag flag)static booleancontainsVar(InsnArg insnArg, RegisterArg arg)static booleancontainsVar(InsnNode insn, RegisterArg arg)static <T extends InsnArg>
booleancontainsVar(java.util.List<T> list, RegisterArg arg)static booleandontGenerateIfNotUsed(InsnNode insn)static java.lang.StringformatOffset(int offset)static java.lang.ObjectgetConstValueByArg(RootNode root, InsnArg arg)Search constant assigned to provided arg.static @Nullable java.lang.ObjectgetConstValueByInsn(RootNode root, InsnNode insn)Return constant value from insn or null if not constant.static @Nullable RegisterArggetRegFromInsn(java.util.List<RegisterArg> regs, InsnType insnType)static @Nullable InsnArggetSingleArg(InsnNode insn)static @Nullable InsnNodegetWrappedInsn(InsnArg arg)static java.lang.StringindexToString(java.lang.Object index)static java.lang.StringinsnTypeToString(InsnType type)static booleanisInsnType(@Nullable InsnNode insn, InsnType insnType)static booleanisWrapped(InsnArg arg, InsnType insnType)static voidreplaceInsns(MethodNode mth, java.util.function.Function<InsnNode,InsnNode> replaceFunction)static voidreplaceInsnsInInsn(MethodNode mth, InsnNode insn, java.util.function.Function<InsnNode,InsnNode> replaceFunction)static @Nullable InsnNodesearchInsn(MethodNode mth, InsnType insnType, java.util.function.Predicate<InsnNode> test)Search instruction of specific type and condition in method.static @Nullable InsnNodesearchSingleReturnInsn(MethodNode mth, java.util.function.Predicate<InsnNode> test)
-
-
-
Method Detail
-
formatOffset
public static java.lang.String formatOffset(int offset)
-
insnTypeToString
public static java.lang.String insnTypeToString(InsnType type)
-
indexToString
public static java.lang.String indexToString(java.lang.Object index)
-
getConstValueByArg
public static java.lang.Object getConstValueByArg(RootNode root, InsnArg arg)
Search constant assigned to provided arg.- Returns:
- LiteralArg, String, ArgType or null
-
getConstValueByInsn
@Nullable public static @Nullable java.lang.Object getConstValueByInsn(RootNode root, InsnNode insn)
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, java.util.function.Predicate<InsnNode> test)
-
searchInsn
@Nullable public static @Nullable InsnNode searchInsn(MethodNode mth, InsnType insnType, java.util.function.Predicate<InsnNode> test)
Search instruction of specific type and condition in method. This method support inlined instructions.
-
replaceInsns
public static void replaceInsns(MethodNode mth, java.util.function.Function<InsnNode,InsnNode> replaceFunction)
-
replaceInsnsInInsn
public static void replaceInsnsInInsn(MethodNode mth, InsnNode insn, java.util.function.Function<InsnNode,InsnNode> replaceFunction)
-
getRegFromInsn
@Nullable public static @Nullable RegisterArg getRegFromInsn(java.util.List<RegisterArg> regs, InsnType insnType)
-
checkInsnType
@Nullable public static @Nullable InsnNode checkInsnType(@Nullable @Nullable InsnNode insn, InsnType insnType)
-
dontGenerateIfNotUsed
public static boolean dontGenerateIfNotUsed(InsnNode insn)
-
containsVar
public static <T extends InsnArg> boolean containsVar(java.util.List<T> list, RegisterArg arg)
-
containsVar
public static boolean containsVar(InsnNode insn, RegisterArg arg)
-
containsVar
public static boolean containsVar(InsnArg insnArg, RegisterArg arg)
-
-