mirror of
https://github.com/revanced/smali.git
synced 2025-06-12 12:17:37 +02:00
Implemented class and method annotations
git-svn-id: https://smali.googlecode.com/svn/trunk@166 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
@ -119,6 +119,14 @@ public class AnnotationDirectoryItem extends OffsettedItem<AnnotationDirectoryIt
|
||||
return "annotation_directory_item @0x" + Integer.toHexString(getOffset());
|
||||
}
|
||||
|
||||
public AnnotationSetItem getClassAnnotations() {
|
||||
return classAnnotationsReferenceField.getReference();
|
||||
}
|
||||
|
||||
public List<MethodAnnotation> getMethodAnnotations() {
|
||||
return methodAnnotationList;
|
||||
}
|
||||
|
||||
public static class FieldAnnotation extends CompositeField<FieldAnnotation>
|
||||
implements Comparable<FieldAnnotation> {
|
||||
private final IndexedItemReference<FieldIdItem> fieldReferenceField;
|
||||
@ -170,6 +178,14 @@ public class AnnotationDirectoryItem extends OffsettedItem<AnnotationDirectoryIt
|
||||
public int compareTo(MethodAnnotation o) {
|
||||
return ((Integer)method.getReference().getIndex()).compareTo(o.method.getReference().getIndex());
|
||||
}
|
||||
|
||||
public MethodIdItem getMethod() {
|
||||
return method.getReference();
|
||||
}
|
||||
|
||||
public AnnotationSetItem getAnnotationSet() {
|
||||
return annotationSet.getReference();
|
||||
}
|
||||
}
|
||||
|
||||
public static class ParameterAnnotation extends CompositeField<ParameterAnnotation>
|
||||
|
@ -60,4 +60,12 @@ public class AnnotationItem extends OffsettedItem<AnnotationItem> {
|
||||
public String getConciseIdentity() {
|
||||
return "annotation_item @0x" + Integer.toHexString(getOffset());
|
||||
}
|
||||
|
||||
public byte getVisibility() {
|
||||
return (byte)visibilityField.getCachedValue();
|
||||
}
|
||||
|
||||
public AnnotationEncodedValueSubField getEncodedAnnotation() {
|
||||
return annotationField;
|
||||
}
|
||||
}
|
||||
|
@ -74,4 +74,13 @@ public class AnnotationSetItem extends OffsettedItem<AnnotationSetItem> {
|
||||
public String getConciseIdentity() {
|
||||
return "annotation_set_item @0x" + Integer.toHexString(getOffset());
|
||||
}
|
||||
|
||||
public List<AnnotationItem> getAnnotationItems() {
|
||||
List<AnnotationItem> annotationItems = new ArrayList<AnnotationItem>();
|
||||
|
||||
for (OffsettedItemReference<AnnotationItem> annotationItemReference: annotationReferences) {
|
||||
annotationItems.add(annotationItemReference.getReference());
|
||||
}
|
||||
return annotationItems;
|
||||
}
|
||||
}
|
||||
|
@ -129,6 +129,10 @@ public class ClassDefItem extends IndexedItem<ClassDefItem> {
|
||||
return classDataReferenceField.getReference();
|
||||
}
|
||||
|
||||
public AnnotationDirectoryItem getAnnotationDirectory() {
|
||||
return classAnnotationsReferenceField.getReference();
|
||||
}
|
||||
|
||||
public String getConciseIdentity() {
|
||||
return "class_def_item: " + getClassName();
|
||||
}
|
||||
|
Reference in New Issue
Block a user