Search in sources :

Example 6 with InsnRemover

use of jadx.core.utils.InsnRemover in project jadx by skylot.

the class ConstructorVisitor method replaceInvoke.

private static boolean replaceInvoke(MethodNode mth) {
    boolean replaced = false;
    InsnRemover remover = new InsnRemover(mth);
    for (BlockNode block : mth.getBasicBlocks()) {
        remover.setBlock(block);
        int size = block.getInstructions().size();
        for (int i = 0; i < size; i++) {
            InsnNode insn = block.getInstructions().get(i);
            if (insn.getType() == InsnType.INVOKE) {
                replaced |= processInvoke(mth, block, i, remover);
            }
        }
        remover.perform();
    }
    return replaced;
}
Also used : BlockNode(jadx.core.dex.nodes.BlockNode) InsnNode(jadx.core.dex.nodes.InsnNode) InsnRemover(jadx.core.utils.InsnRemover)

Aggregations

InsnRemover (jadx.core.utils.InsnRemover)6 InsnNode (jadx.core.dex.nodes.InsnNode)5 BlockNode (jadx.core.dex.nodes.BlockNode)4 IndexInsnNode (jadx.core.dex.instructions.IndexInsnNode)2