mirror of
https://github.com/revanced/smali.git
synced 2025-06-12 12:17:37 +02:00
Misc cleanup/refactoring
git-svn-id: https://smali.googlecode.com/svn/trunk@206 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
@ -45,7 +45,7 @@ public class AnnotationDirectoryItem extends OffsettedItem<AnnotationDirectoryIt
|
||||
private final FieldListField<MethodAnnotation> methodAnnotationListField;
|
||||
private final FieldListField<ParameterAnnotation> parameterAnnotationListField;
|
||||
|
||||
public AnnotationDirectoryItem(final DexFile dexFile, int offset) {
|
||||
protected AnnotationDirectoryItem(final DexFile dexFile, int offset) {
|
||||
super(offset);
|
||||
|
||||
fields = new Field[] {
|
||||
@ -76,7 +76,7 @@ public class AnnotationDirectoryItem extends OffsettedItem<AnnotationDirectoryIt
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public AnnotationDirectoryItem(final DexFile dexFile,
|
||||
AnnotationSetItem classAnnotations,
|
||||
List<FieldAnnotation> fieldAnnotations,
|
||||
@ -135,7 +135,6 @@ public class AnnotationDirectoryItem extends OffsettedItem<AnnotationDirectoryIt
|
||||
return Collections.unmodifiableList(parameterAnnotationList);
|
||||
}
|
||||
|
||||
|
||||
public static class FieldAnnotation extends CompositeField<FieldAnnotation>
|
||||
implements Comparable<FieldAnnotation> {
|
||||
private final IndexedItemReference<FieldIdItem> fieldReferenceField;
|
||||
|
@ -61,11 +61,35 @@ public class AnnotationItem extends OffsettedItem<AnnotationItem> {
|
||||
return "annotation_item @0x" + Integer.toHexString(getOffset());
|
||||
}
|
||||
|
||||
public byte getVisibility() {
|
||||
return (byte)visibilityField.getCachedValue();
|
||||
public Visibility getVisibility() {
|
||||
return Visibility.get((byte)visibilityField.getCachedValue());
|
||||
}
|
||||
|
||||
public AnnotationEncodedValueSubField getEncodedAnnotation() {
|
||||
return annotationField;
|
||||
}
|
||||
|
||||
public enum Visibility {
|
||||
build(0x00),
|
||||
runtime(0x01),
|
||||
system(0x02);
|
||||
|
||||
public final byte value;
|
||||
|
||||
private Visibility(int value) {
|
||||
this.value = (byte)value;
|
||||
}
|
||||
|
||||
public static Visibility get(byte value) {
|
||||
switch (value) {
|
||||
case 0x00:
|
||||
return build;
|
||||
case 0x01:
|
||||
return runtime;
|
||||
case 0x02:
|
||||
return system;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user