Java Code Examples for org.jf.dexlib2.iface.AnnotationElement#getValue()

The following examples show how to use org.jf.dexlib2.iface.AnnotationElement#getValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ImmutableAnnotationElement.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
public static ImmutableAnnotationElement of(AnnotationElement annotationElement) {
    if (annotationElement instanceof ImmutableAnnotationElement) {
        return (ImmutableAnnotationElement)annotationElement;
    }
    return new ImmutableAnnotationElement(
            annotationElement.getName(),
            annotationElement.getValue());
}
 
Example 2
Source File: ApkPatch.java    From atlas with Apache License 2.0 5 votes vote down vote up
public static void getMethodAnnotaionPrepareClasses(DexDiffInfo dexDiffInfo, Set<String> prepareclasses){

        for (DexBackedMethod method:dexDiffInfo.getModifiedMethods()){
            Set<? extends Annotation>annotations = method.getAnnotations();
            if (annotations == null){
                continue;
            }
            for (Annotation annotation:annotations){
                String type = annotation.getType();
                if (type!= null&&type.startsWith("L")&&type.endsWith(";")){
                    prepareclasses.add(type.substring(1, type.length() - 1).replace('/', '.'));
                    System.out.println("prepare class: " + type);
                }
                Set<? extends AnnotationElement> elements = annotation.getElements();
                for (AnnotationElement dexBackedAnnotationElement:elements){
                    if (dexBackedAnnotationElement.getValue() instanceof DexBackedArrayEncodedValue){
                        List<? extends EncodedValue> values = ((DexBackedArrayEncodedValue) dexBackedAnnotationElement.getValue()).getValue();
                        for (EncodedValue encodedValue:values) {
                            if (encodedValue instanceof TypeEncodedValue) {
                                prepareclasses.add(((TypeEncodedValue) encodedValue).getValue().substring(1, ((TypeEncodedValue) encodedValue).getValue().length() - 1).replace('/', '.'));
                                System.out.println("prepare class: " + ((TypeEncodedValue) encodedValue).getValue());
                            }
                        }

                    }else if (dexBackedAnnotationElement.getValue() instanceof DexBackedTypeEncodedValue){
                        String value = ((DexBackedTypeEncodedValue) dexBackedAnnotationElement.getValue()).getValue();
                        prepareclasses.add(value.substring(1, value.length() - 1).replace('/', '.'));
                        System.out.println("prepare class: " + value);
                    }
                }
            }
        }

    }
 
Example 3
Source File: ImmutableAnnotationElement.java    From zjdroid with Apache License 2.0 5 votes vote down vote up
public static ImmutableAnnotationElement of(AnnotationElement annotationElement) {
    if (annotationElement instanceof ImmutableAnnotationElement) {
        return (ImmutableAnnotationElement)annotationElement;
    }
    return new ImmutableAnnotationElement(
            annotationElement.getName(),
            annotationElement.getValue());
}
 
Example 4
Source File: ImmutableAnnotationElement.java    From HeyGirl with Apache License 2.0 5 votes vote down vote up
public static ImmutableAnnotationElement of(AnnotationElement annotationElement) {
    if (annotationElement instanceof ImmutableAnnotationElement) {
        return (ImmutableAnnotationElement)annotationElement;
    }
    return new ImmutableAnnotationElement(
            annotationElement.getName(),
            annotationElement.getValue());
}
 
Example 5
Source File: ImmutableAnnotationElement.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
public static ImmutableAnnotationElement of(AnnotationElement annotationElement) {
    if (annotationElement instanceof ImmutableAnnotationElement) {
        return (ImmutableAnnotationElement)annotationElement;
    }
    return new ImmutableAnnotationElement(
            annotationElement.getName(),
            annotationElement.getValue());
}
 
Example 6
Source File: AnnotationPool.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public EncodedValue getElementValue(@Nonnull AnnotationElement annotationElement) {
    return annotationElement.getValue();
}
 
Example 7
Source File: AnnotationPool.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public EncodedValue getElementValue(@Nonnull AnnotationElement annotationElement) {
    return annotationElement.getValue();
}
 
Example 8
Source File: AnnotationPool.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public EncodedValue getElementValue(@Nonnull AnnotationElement annotationElement) {
    return annotationElement.getValue();
}
 
Example 9
Source File: AnnotationPool.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public EncodedValue getElementValue(@Nonnull AnnotationElement annotationElement) {
    return annotationElement.getValue();
}