use of org.jf.dexlib2.iface.reference.Reference in project android-bundle-support by lizhangqu.
the class DexFieldNode method isSeed.
@Override
public boolean isSeed(@Nullable ProguardSeedsMap seedsMap, @Nullable ProguardMap map, boolean checkChildren) {
if (seedsMap != null) {
FieldReference reference = getReference();
if (reference != null) {
String fieldName = PackageTreeCreator.decodeFieldName(reference, map);
String className = PackageTreeCreator.decodeClassName(reference.getDefiningClass(), map);
return seedsMap.hasField(className, fieldName);
}
}
return false;
}
use of org.jf.dexlib2.iface.reference.Reference in project android-bundle-support by lizhangqu.
the class DexReferences method addEncodedValue.
private void addEncodedValue(Map<Reference, ImmutableReference> immutableReferencesBin, Map<String, ImmutableTypeReference> typesByName, Reference ref, EncodedValue value) {
if (value instanceof AnnotationEncodedValue) {
ImmutableTypeReference typeRef = typesByName.get(((AnnotationEncodedValue) value).getType());
addReference(typeRef, ref, immutableReferencesBin);
for (AnnotationElement element : ((AnnotationEncodedValue) value).getElements()) {
addEncodedValue(immutableReferencesBin, typesByName, ref, element.getValue());
}
} else if (value instanceof ArrayEncodedValue) {
for (EncodedValue encodedValue : ((ArrayEncodedValue) value).getValue()) {
addEncodedValue(immutableReferencesBin, typesByName, ref, encodedValue);
}
} else if (value instanceof EnumEncodedValue) {
addReferenceAndEnclosingClass(immutableReferencesBin, typesByName, ref, ((EnumEncodedValue) value).getValue());
} else if (value instanceof TypeEncodedValue) {
ImmutableTypeReference typeRef = typesByName.get(((TypeEncodedValue) value).getValue());
addReference(typeRef, ref, immutableReferencesBin);
}
}
use of org.jf.dexlib2.iface.reference.Reference in project android-bundle-support by lizhangqu.
the class DexReferences method addAnnotation.
private void addAnnotation(Map<Reference, ImmutableReference> immutableReferencesBin, Map<String, ImmutableTypeReference> typesByName, Reference ref, Annotation annotation) {
ImmutableReference typeRef = typesByName.get(annotation.getType());
addReference(typeRef, ref, immutableReferencesBin);
Set<? extends AnnotationElement> elements = annotation.getElements();
for (AnnotationElement element : elements) {
EncodedValue value = element.getValue();
addEncodedValue(immutableReferencesBin, typesByName, ref, value);
}
}
Aggregations