Search in sources :

Example 1 with Element

use of net.runelite.asm.attributes.annotation.Element in project runelite by runelite.

the class AnnotationMapper method copyAnnotations.

private int copyAnnotations(Annotations from, Annotations to) {
    int count = 0;
    if (from.getAnnotations() == null)
        return count;
    for (Annotation a : from.getAnnotations()) {
        if (isCopyable(a)) {
            Annotation annotation = new Annotation(to);
            annotation.setType(a.getType());
            to.addAnnotation(annotation);
            for (Element e : a.getElements()) {
                Element element = new Element(annotation);
                element.setName(e.getName());
                element.setValue(e.getValue());
                annotation.addElement(element);
            }
            ++count;
        }
    }
    return count;
}
Also used : Element(net.runelite.asm.attributes.annotation.Element) Annotation(net.runelite.asm.attributes.annotation.Annotation)

Example 2 with Element

use of net.runelite.asm.attributes.annotation.Element in project runelite by runelite.

the class ClassAnnotationVisitor method visit.

@Override
public void visit(String name, Object value) {
    Element element = new Element(annotation);
    element.setName(name);
    element.setValue(value);
    annotation.addElement(element);
}
Also used : Element(net.runelite.asm.attributes.annotation.Element)

Example 3 with Element

use of net.runelite.asm.attributes.annotation.Element in project runelite by runelite.

the class FieldAnnotationVisitor method visit.

@Override
public void visit(String name, Object value) {
    Element element = new Element(annotation);
    element.setName(name);
    element.setValue(value);
    annotation.addElement(element);
}
Also used : Element(net.runelite.asm.attributes.annotation.Element)

Example 4 with Element

use of net.runelite.asm.attributes.annotation.Element in project runelite by runelite.

the class MethodAnnotationVisitor method visit.

@Override
public void visit(String name, Object value) {
    Element element = new Element(annotation);
    element.setName(name);
    element.setValue(value);
    annotation.addElement(element);
}
Also used : Element(net.runelite.asm.attributes.annotation.Element)

Example 5 with Element

use of net.runelite.asm.attributes.annotation.Element in project runelite by runelite.

the class DeobAnnotations method getObfuscatedValue.

public static String getObfuscatedValue(Method method) {
    if (method == null || method.getAnnotations() == null) {
        return null;
    }
    Annotation an = method.getAnnotations().find(OBFUSCATED_SIGNATURE);
    if (an == null) {
        return null;
    }
    List<Element> elements = an.getElements();
    if (elements == null || elements.size() < 2) {
        return null;
    }
    return (String) elements.get(1).getValue();
}
Also used : Element(net.runelite.asm.attributes.annotation.Element) Annotation(net.runelite.asm.attributes.annotation.Annotation)

Aggregations

Element (net.runelite.asm.attributes.annotation.Element)9 Annotation (net.runelite.asm.attributes.annotation.Annotation)6 Method (net.runelite.asm.Method)2 Annotations (net.runelite.asm.attributes.Annotations)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 List (java.util.List)1 Optional (java.util.Optional)1 ClassFile (net.runelite.asm.ClassFile)1 ClassGroup (net.runelite.asm.ClassGroup)1 ClassUtil (net.runelite.asm.ClassUtil)1 Type (net.runelite.asm.Type)1 DeobAnnotations (net.runelite.deob.DeobAnnotations)1 JarUtil (net.runelite.deob.util.JarUtil)1 Assert (org.junit.Assert)1 Test (org.junit.Test)1