Package jadx.core.utils

Examples of jadx.core.utils.InstructionRemover


  @Override
  public void visit(MethodNode mth) throws JadxException {
    if (mth.isNoCode()) {
      return;
    }
    InstructionRemover remover = new InstructionRemover(mth);
    for (BlockNode block : mth.getBasicBlocks()) {
      remover.setBlock(block);
      List<InsnNode> instructions = block.getInstructions();
      int size = instructions.size();
      for (int i = 0; i < size; i++) {
        InsnNode replacedInsn = process(mth, instructions, i, remover);
        if (replacedInsn != null) {
          instructions.set(i, replacedInsn);
        }
      }
      remover.perform();
    }
  }
View Full Code Here


        excHandler.addBlock(block);
        for (BlockNode node : BlockUtils.collectBlocksDominatedBy(block, block)) {
          excHandler.addBlock(node);
        }
        for (BlockNode excBlock : excHandler.getBlocks()) {
          InstructionRemover remover = new InstructionRemover(mth, excBlock);
          for (InsnNode insn : excBlock.getInstructions()) {
            if (insn.getType() == InsnType.MONITOR_ENTER) {
              break;
            }
            if (insn.getType() == InsnType.MONITOR_EXIT) {
              remover.add(insn);
            }
          }
          remover.perform();

          for (InsnNode insn : excBlock.getInstructions()) {
            if (insn.getType() == InsnType.THROW) {
              CatchAttr catchAttr = insn.get(AType.CATCH_BLOCK);
              if (catchAttr != null) {
View Full Code Here

  public void visit(MethodNode mth) {
    if (mth.isNoCode()) {
      return;
    }

    InstructionRemover remover = new InstructionRemover(mth);
    replaceStep(mth, remover);
    removeStep(mth, remover);

    checkArgsNames(mth);
View Full Code Here

      for (BlockNode node : BlockUtils.collectBlocksDominatedBy(block, block)) {
        excHandler.addBlock(node);
      }
      for (BlockNode excBlock : excHandler.getBlocks()) {
        // remove 'monitor-exit' from exception handler blocks
        InstructionRemover remover = new InstructionRemover(mth, excBlock);
        for (InsnNode insn : excBlock.getInstructions()) {
          if (insn.getType() == InsnType.MONITOR_ENTER) {
            break;
          }
          if (insn.getType() == InsnType.MONITOR_EXIT) {
            remover.add(insn);
          }
        }
        remover.perform();

        // if 'throw' in exception handler block have 'catch' - merge these catch blocks
        for (InsnNode insn : excBlock.getInstructions()) {
          if (insn.getType() == InsnType.THROW) {
            CatchAttr catchAttr = insn.get(AType.CATCH_BLOCK);
View Full Code Here

TOP

Related Classes of jadx.core.utils.InstructionRemover

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.