use of jadx.api.plugins.input.data.annotations.AnnotationVisibility in project jadx by skylot.
the class Smali method writeAnnotation.
private void writeAnnotation(SmaliWriter smali, IAnnotation anno) {
smali.add(".annotation").add(" ");
AnnotationVisibility vby = anno.getVisibility();
if (vby != null) {
smali.add(vby.toString().toLowerCase()).add(" ");
}
smali.add(anno.getAnnotationClass());
anno.getValues().forEach((k, v) -> {
smali.incIndent();
smali.startLine(k).add(" = ");
writeEncodedValue(smali, v, true);
smali.decIndent();
});
smali.startLine(".end annotation");
}
use of jadx.api.plugins.input.data.annotations.AnnotationVisibility in project jadx by skylot.
the class AnnotationsParser method readAnnotation.
public static IAnnotation readAnnotation(SectionReader in, SectionReader ext, boolean readVisibility) {
AnnotationVisibility visibility = null;
if (readVisibility) {
int v = in.readUByte();
visibility = getVisibilityValue(v);
}
int typeIndex = in.readUleb128();
int size = in.readUleb128();
Map<String, EncodedValue> values = new LinkedHashMap<>(size);
for (int i = 0; i < size; i++) {
String name = ext.getString(in.readUleb128());
values.put(name, EncodedValueParser.parseValue(in, ext));
}
String type = ext.getType(typeIndex);
return new JadxAnnotation(visibility, type, values);
}
Aggregations