mirror of
https://github.com/revanced/smali.git
synced 2025-05-04 08:34:25 +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:
parent
56d16a23f6
commit
0871036088
@ -44,15 +44,7 @@ public class AnnotationAdaptor {
|
||||
}
|
||||
|
||||
public String getVisibility() {
|
||||
switch (annotationItem.getVisibility()) {
|
||||
case 0:
|
||||
return "build";
|
||||
case 1:
|
||||
return "runtime";
|
||||
case 2:
|
||||
return "system";
|
||||
}
|
||||
return null;
|
||||
return annotationItem.getVisibility().name();
|
||||
}
|
||||
|
||||
public TypeReference getAnnotationType() {
|
||||
|
@ -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[] {
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ tokens {
|
||||
@header {
|
||||
package org.jf.smali;
|
||||
|
||||
import org.jf.dexlib.code.Format.*;
|
||||
import org.jf.dexlib.Code.Format.*;
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,9 +40,9 @@ import java.util.HashMap;
|
||||
|
||||
import org.jf.dexlib.*;
|
||||
import org.jf.dexlib.EncodedValue.*;
|
||||
import org.jf.dexlib.util.*;
|
||||
import org.jf.dexlib.code.*;
|
||||
import org.jf.dexlib.code.Format.*;
|
||||
import org.jf.dexlib.Util.*;
|
||||
import org.jf.dexlib.Code.*;
|
||||
import org.jf.dexlib.Code.Format.*;
|
||||
}
|
||||
|
||||
@members {
|
||||
|
Loading…
x
Reference in New Issue
Block a user