Search in sources :

Example 1 with JumpInfo

use of jadx.core.dex.attributes.nodes.JumpInfo in project jadx by skylot.

the class BlockSplitter method setupConnections.

private static void setupConnections(MethodNode mth, Map<Integer, BlockNode> blocksMap) {
    for (BlockNode block : mth.getBasicBlocks()) {
        for (InsnNode insn : block.getInstructions()) {
            List<JumpInfo> jumps = insn.getAll(AType.JUMP);
            for (JumpInfo jump : jumps) {
                BlockNode srcBlock = getBlock(jump.getSrc(), blocksMap);
                BlockNode thisBlock = getBlock(jump.getDest(), blocksMap);
                connect(srcBlock, thisBlock);
            }
            connectExceptionHandlers(blocksMap, block, insn);
        }
    }
}
Also used : BlockNode(jadx.core.dex.nodes.BlockNode) InsnNode(jadx.core.dex.nodes.InsnNode) JumpInfo(jadx.core.dex.attributes.nodes.JumpInfo)

Example 2 with JumpInfo

use of jadx.core.dex.attributes.nodes.JumpInfo in project jadx by skylot.

the class BlockSplitter method isSplitByJump.

private static boolean isSplitByJump(InsnNode prevInsn, InsnNode currentInsn) {
    List<JumpInfo> pJumps = prevInsn.getAll(AType.JUMP);
    for (JumpInfo jump : pJumps) {
        if (jump.getSrc() == prevInsn.getOffset()) {
            return true;
        }
    }
    List<JumpInfo> cJumps = currentInsn.getAll(AType.JUMP);
    for (JumpInfo jump : cJumps) {
        if (jump.getDest() == currentInsn.getOffset()) {
            return true;
        }
    }
    return false;
}
Also used : JumpInfo(jadx.core.dex.attributes.nodes.JumpInfo)

Aggregations

JumpInfo (jadx.core.dex.attributes.nodes.JumpInfo)2 BlockNode (jadx.core.dex.nodes.BlockNode)1 InsnNode (jadx.core.dex.nodes.InsnNode)1