Package jadx.core.dex.nodes

Examples of jadx.core.dex.nodes.FieldNode


            break;

          case CONST:
          case CONST_STR:
          case CONST_CLASS: {
            FieldNode f;
            if (insn.getType() == InsnType.CONST_STR) {
              String s = ((ConstStringNode) insn).getString();
              f = parentClass.getConstField(s);
            } else if (insn.getType() == InsnType.CONST_CLASS) {
              ArgType t = ((ConstClassNode) insn).getClsType();
              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


      }
    } else if (inv.getArgsCount() > 0) {
      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.nodes.FieldNode

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.