Package jadx.core.dex.instructions

Examples of jadx.core.dex.instructions.IndexInsnNode


    int size = list.size();
    for (int i = 0; i < size; i++) {
      InsnNode insn = list.get(i);
      insns.add(insn);
      if (insn.getType() == InsnType.SPUT) {
        IndexInsnNode fp = (IndexInsnNode) insn;
        FieldInfo f = (FieldInfo) fp.getIndex();
        if (f.getName().equals("$VALUES")) {
          if (i == size - 1) {
            cls.getMethods().remove(staticMethod);
          } else {
            list.subList(0, i + 1).clear();
View Full Code Here


    }
    InsnNode insn = instructions.get(0);
    if (insn.getType() != InsnType.IPUT) {
      return false;
    }
    IndexInsnNode putInsn = (IndexInsnNode) insn;
    FieldInfo fieldInfo = (FieldInfo) putInsn.getIndex();
    if (!fieldInfo.equals(field.getFieldInfo()) || !putInsn.getArg(0).equals(arg)) {
      return false;
    }
    mth.removeFirstArgument();
    InstructionRemover.remove(mth, block, insn);
    // other arg usage -> wrap with IGET insn
    if (arg.getSVar().getUseCount() != 0) {
      InsnNode iget = new IndexInsnNode(InsnType.IGET, fieldInfo, 1);
      iget.addArg(insn.getArg(1));
      for (InsnArg insnArg : arg.getSVar().getUseList()) {
        insnArg.wrapInstruction(iget);
      }
    }
    return true;
View Full Code Here

        insn.getArg(0).merge(insn.getResult());
        break;

      case IPUT:
      case SPUT:
        IndexInsnNode node = (IndexInsnNode) insn;
        insn.getArg(0).merge(((FieldInfo) node.getIndex()).getType());
        break;

      case IF: {
        InsnArg arg0 = insn.getArg(0);
        InsnArg arg1 = insn.getArg(1);
View Full Code Here

              f = parentClass.getConstField(t);
            } else {
              f = parentClass.getConstFieldByLiteralArg((LiteralArg) insn.getArg(0));
            }
            if (f != null) {
              InsnNode inode = new IndexInsnNode(InsnType.SGET, f.getFieldInfo(), 0);
              inode.setResult(insn.getResult());
              replaceInsn(block, i, inode);
            }
            break;
          }

          case SWITCH:
            SwitchNode sn = (SwitchNode) insn;
            for (int k = 0; k < sn.getCasesCount(); k++) {
              FieldNode f = parentClass.getConstField(sn.getKeys()[k]);
              if (f != null) {
                sn.getKeys()[k] = new IndexInsnNode(InsnType.SGET, f.getFieldInfo(), 0);
              }
            }
            break;

          case RETURN:
            if (insn.getArgsCount() > 0 && insn.getArg(0).isLiteral()) {
              LiteralArg arg = (LiteralArg) insn.getArg(0);
              FieldNode f = parentClass.getConstFieldByLiteralArg(arg);
              if (f != null) {
                arg.wrapInstruction(new IndexInsnNode(InsnType.SGET, f.getFieldInfo(), 0));
              }
            }
            break;

          default:
View Full Code Here

      for (int j = 0; j < inv.getArgsCount(); j++) {
        InsnArg arg = inv.getArg(j);
        if (arg.isLiteral()) {
          FieldNode f = parentClass.getConstFieldByLiteralArg((LiteralArg) arg);
          if (f != null) {
            arg.wrapInstruction(new IndexInsnNode(InsnType.SGET, f.getFieldInfo(), 0));
          }
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of jadx.core.dex.instructions.IndexInsnNode

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.