Package jadx.core.dex.attributes.annotations

Examples of jadx.core.dex.attributes.annotations.Annotation


    Section section = dex.openSection(offset);
    int size = section.readInt();
    List<Annotation> list = new ArrayList<Annotation>(size);
    for (int i = 0; i < size; i++) {
      Section anSection = dex.openSection(section.readInt());
      Annotation a = readAnnotation(dex, anSection, true);
      list.add(a);
    }
    return new AnnotationsList(list);
  }
View Full Code Here


    for (int i = 0; i < size; i++) {
      String name = dex.getString(s.readUleb128());
      values.put(name, parser.parseValue());
    }
    ArgType type = dex.getType(typeIndex);
    Annotation annotation = new Annotation(visibility, type, values);
    if (!type.isObject()) {
      throw new DecodeException("Incorrect type for annotation: " + annotation);
    }
    return annotation;
  }
View Full Code Here

        }
      }

      // restore original access flags from dalvik annotation if present
      int accFlagsValue;
      Annotation a = getAnnotation(Consts.DALVIK_INNER_CLASS);
      if (a != null) {
        accFlagsValue = (Integer) a.getValues().get("accessFlags");
      } else {
        accFlagsValue = cls.getAccessFlags();
      }
      this.accessFlags = new AccessInfo(accFlagsValue, AFType.CLASS);
View Full Code Here

    mark = 0;
  }

  @SuppressWarnings("unchecked")
  public static SignatureParser fromNode(IAttributeNode node) {
    Annotation a = node.getAnnotation(Consts.DALVIK_SIGNATURE);
    if (a == null) {
      return null;
    }
    return new SignatureParser(mergeSignature((List<String>) a.getDefaultValue()));
  }
View Full Code Here

    }
  }

  @SuppressWarnings("unchecked")
  public void addThrows(MethodNode mth, CodeWriter code) {
    Annotation an = mth.getAnnotation(Consts.DALVIK_THROWS);
    if (an != null) {
      Object exs = an.getDefaultValue();
      code.add(" throws ");
      for (Iterator<ArgType> it = ((List<ArgType>) exs).iterator(); it.hasNext(); ) {
        ArgType ex = it.next();
        classGen.useType(code, ex);
        if (it.hasNext()) {
View Full Code Here

      }
    }
  }

  public Object getAnnotationDefaultValue(String name) {
    Annotation an = cls.getAnnotation(Consts.DALVIK_ANNOTATION_DEFAULT);
    if (an != null) {
      Annotation defAnnotation = (Annotation) an.getDefaultValue();
      return defAnnotation.getValues().get(name);
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of jadx.core.dex.attributes.annotations.Annotation

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.