Package jadx.core.dex.nodes.parser

Examples of jadx.core.dex.nodes.parser.FieldValueAttr


        return ((ConstClassNode) parInsn).getClsType();
      case SGET:
        FieldInfo f = (FieldInfo) ((IndexInsnNode) parInsn).getIndex();
        FieldNode fieldNode = dex.resolveField(f);
        if (fieldNode != null) {
          FieldValueAttr attr = fieldNode.get(AType.FIELD_VALUE);
          if (attr != null) {
            return attr.getValue();
          }
        } else {
          LOG.warn("Field {} not found in dex {}", f, dex);
        }
        break;
View Full Code Here


  }

  private void loadStaticValues(ClassDef cls, List<FieldNode> staticFields) throws DecodeException {
    for (FieldNode f : staticFields) {
      if (f.getAccessFlags().isFinal()) {
        f.addAttr(new FieldValueAttr(null));
      }
    }

    int offset = cls.getStaticValuesOffset();
    if (offset != 0) {
      StaticValuesParser parser = new StaticValuesParser(dex, dex.openSection(offset));
      int count = parser.processFields(staticFields);
      constFields = new LinkedHashMap<Object, FieldNode>(count);
      for (FieldNode f : staticFields) {
        AccessInfo accFlags = f.getAccessFlags();
        if (accFlags.isStatic() && accFlags.isFinal()) {
          FieldValueAttr fv = f.get(AType.FIELD_VALUE);
          if (fv != null && fv.getValue() != null) {
            if (accFlags.isPublic()) {
              dex.getConstFields().put(fv.getValue(), f);
            }
            constFields.put(fv.getValue(), f);
          }
        }
      }
    }
  }
View Full Code Here

      annotationGen.addForField(code, f);
      code.startLine(f.getAccessFlags().makeString());
      useType(code, f.getType());
      code.add(' ');
      code.add(f.getName());
      FieldValueAttr fv = f.get(AType.FIELD_VALUE);
      if (fv != null) {
        code.add(" = ");
        if (fv.getValue() == null) {
          code.add(TypeGen.literalToString(0, f.getType()));
        } else {
          annotationGen.encodeValue(code, fv.getValue());
        }
      }
      code.add(';');
      code.attachDefinition(f);
    }
View Full Code Here

TOP

Related Classes of jadx.core.dex.nodes.parser.FieldValueAttr

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.