org.jf.dexlib2.immutable.value.ImmutableEncodedValue Java Examples

The following examples show how to use org.jf.dexlib2.immutable.value.ImmutableEncodedValue. 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: ImmutableField.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
public ImmutableField(@Nonnull String definingClass,
                      @Nonnull String name,
                      @Nonnull String type,
                      int accessFlags,
                      @Nullable ImmutableEncodedValue initialValue,
                      @Nullable ImmutableSet<? extends ImmutableAnnotation> annotations) {
    this.definingClass = definingClass;
    this.name = name;
    this.type = type;
    this.accessFlags = accessFlags;
    this.initialValue = initialValue;
    this.annotations = ImmutableUtils.nullToEmptySet(annotations);
}
 
Example #2
Source File: ImmutableField.java    From zjdroid with Apache License 2.0 5 votes vote down vote up
public ImmutableField(@Nonnull String definingClass,
                      @Nonnull String name,
                      @Nonnull String type,
                      int accessFlags,
                      @Nullable ImmutableEncodedValue initialValue,
                      @Nullable ImmutableSet<? extends ImmutableAnnotation> annotations) {
    this.definingClass = definingClass;
    this.name = name;
    this.type = type;
    this.accessFlags = accessFlags;
    this.initialValue = initialValue;
    this.annotations = ImmutableUtils.nullToEmptySet(annotations);
}
 
Example #3
Source File: ImmutableField.java    From HeyGirl with Apache License 2.0 5 votes vote down vote up
public ImmutableField(@Nonnull String definingClass,
                      @Nonnull String name,
                      @Nonnull String type,
                      int accessFlags,
                      @Nullable ImmutableEncodedValue initialValue,
                      @Nullable ImmutableSet<? extends ImmutableAnnotation> annotations) {
    this.definingClass = definingClass;
    this.name = name;
    this.type = type;
    this.accessFlags = accessFlags;
    this.initialValue = initialValue;
    this.annotations = ImmutableUtils.nullToEmptySet(annotations);
}
 
Example #4
Source File: ImmutableField.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
public ImmutableField(@Nonnull String definingClass,
                      @Nonnull String name,
                      @Nonnull String type,
                      int accessFlags,
                      @Nullable ImmutableEncodedValue initialValue,
                      @Nullable ImmutableSet<? extends ImmutableAnnotation> annotations) {
    this.definingClass = definingClass;
    this.name = name;
    this.type = type;
    this.accessFlags = accessFlags;
    this.initialValue = initialValue;
    this.annotations = ImmutableUtils.nullToEmptySet(annotations);
}
 
Example #5
Source File: ImmutableAnnotationElement.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
public ImmutableAnnotationElement(@Nonnull String name,
                                  @Nonnull ImmutableEncodedValue value) {
    this.name = name;
    this.value = value;
}
 
Example #6
Source File: ImmutableAnnotationElement.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
public ImmutableAnnotationElement(@Nonnull String name,
                                  @Nonnull ImmutableEncodedValue value) {
    this.name = name;
    this.value = value;
}
 
Example #7
Source File: DexPrinter.java    From JAADAS with GNU General Public License v3.0 4 votes vote down vote up
private List<Annotation> buildInnerClassAttribute(SootClass parentClass,
 		InnerClassAttribute t, Set<String> skipList) {
 	if (t.getSpecs() == null)
 		return null;
 	
 	List<Annotation> anns = null;
 	for (Tag t2 : t.getSpecs()) {
 		InnerClassTag icTag = (InnerClassTag) t2;
 		
     	// In Dalvik, both the EnclosingMethod/EnclosingClass tag and the
     	// InnerClass tag are written to the inner class which is different
     	// to Java. We thus check whether this tag actually points to our
 		// outer class.
 		String outerClass = getOuterClassNameFromTag(icTag);
String innerClass = icTag.getInnerClass().replaceAll("/", ".");
			
// Only write the InnerClass tag to the inner class itself, not
// the other one. If the outer class points to our parent, but
// this is simply the wrong inner class, we also continue with the
// next tag.
 		if (!parentClass.hasOuterClass()
 				|| !innerClass.equals(parentClass.getName()))
 			continue;
 		
 		// If the outer class points to the very same class, we null it
 		if (parentClass.getName().equals(outerClass)
 				&& icTag.getOuterClass() == null)
 			outerClass = null;
 		
 		// Do not write garbage. Never.
 		if (parentClass.getName().equals(outerClass))
 			continue;
 		
 		// This is an actual inner class. Write the annotation
     	if (skipList.add("Ldalvik/annotation/InnerClass;")) {
  		// InnerClass annotation
      	List<AnnotationElement> elements = new ArrayList<AnnotationElement>();
   	
   	ImmutableAnnotationElement flagsElement = new ImmutableAnnotationElement
   			("accessFlags", new ImmutableIntEncodedValue(icTag.getAccessFlags()));
   	elements.add(flagsElement);
   	
   	ImmutableEncodedValue nameValue;
   	if (icTag.getShortName() != null && !icTag.getShortName().isEmpty())
   		nameValue = new ImmutableStringEncodedValue(icTag.getShortName());
   	else
   		nameValue = ImmutableNullEncodedValue.INSTANCE;
   	
   	ImmutableAnnotationElement nameElement = new ImmutableAnnotationElement
    		("name", nameValue);
    elements.add(nameElement);
   	
   	if (anns == null) anns = new ArrayList<Annotation>();
   	anns.add(new ImmutableAnnotation(AnnotationVisibility.SYSTEM,
   			"Ldalvik/annotation/InnerClass;",
   			elements));
     	}
 	}
 	    	
 	return anns;
 }
 
Example #8
Source File: ImmutableAnnotationElement.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
public ImmutableAnnotationElement(@Nonnull String name,
                                  @Nonnull ImmutableEncodedValue value) {
    this.name = name;
    this.value = value;
}
 
Example #9
Source File: ImmutableAnnotationElement.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
public ImmutableAnnotationElement(@Nonnull String name,
                                  @Nonnull ImmutableEncodedValue value) {
    this.name = name;
    this.value = value;
}