Пример #1
0
 /**
  * Converts field annotations from Dexlib to Jimple
  *
  * @param h
  * @param f
  */
 void handleFieldAnnotation(Host h, Field f) {
   Set<? extends Annotation> aSet = f.getAnnotations();
   if (aSet != null && !aSet.isEmpty()) {
     List<Tag> tags = handleAnnotation(aSet, null);
     if (tags != null)
       for (Tag t : tags)
         if (t != null) {
           h.addTag(t);
           Debug.printDbg("add field annotation: ", t);
         }
   }
 }
  @Override
  public FieldInfo[] getDeclaredFields() {
    List<FieldInfo> result = new ArrayList<>();
    Iterable<? extends Field> implFields = classDef.getFields();

    for (Field field : implFields) {
      FieldInfo fi = new FieldInfo();
      fi.typeName = DexlibAdapter.getTypeName(field.getType());
      fi.modifiers = field.getAccessFlags();
      fi.annotations = convertAnnotations(field.getAnnotations());
      fi.name = field.getName();

      result.add(fi);
    }

    FieldInfo[] array = new FieldInfo[result.size()];
    return result.toArray(array);
  }