mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-05 15:28:18 +03:00
[FIX] Ещё баги в asm.
This commit is contained in:
parent
3441fc21a7
commit
5de7eedc35
1 changed files with 16 additions and 10 deletions
|
@ -3,6 +3,7 @@
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.objectweb.asm.ClassReader;
|
import org.objectweb.asm.ClassReader;
|
||||||
|
@ -42,6 +43,8 @@ public static ClassNode forClass(String clazz, int flags, ClassMetadataReader r)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<AnnotationNode> annots(String clazz, String method, ClassMetadataReader r) {
|
public static List<AnnotationNode> annots(String clazz, String method, ClassMetadataReader r) {
|
||||||
|
if (clazz.startsWith("L")) clazz = Type.getType(clazz).getInternalName();
|
||||||
|
try {
|
||||||
List<AnnotationNode> ret = new ArrayList<>();
|
List<AnnotationNode> ret = new ArrayList<>();
|
||||||
ClassNode n = forClass(clazz, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG, r);
|
ClassNode n = forClass(clazz, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG, r);
|
||||||
if (n.visibleAnnotations != null) ret.addAll(n.visibleAnnotations);
|
if (n.visibleAnnotations != null) ret.addAll(n.visibleAnnotations);
|
||||||
|
@ -52,6 +55,9 @@ public static List<AnnotationNode> annots(String clazz, String method, ClassMeta
|
||||||
if (m.invisibleAnnotations != null) ret.addAll(m.invisibleAnnotations);
|
if (m.invisibleAnnotations != null) ret.addAll(m.invisibleAnnotations);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
} catch (Throwable e) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int doMethodEmulation(String desc) {
|
private static int doMethodEmulation(String desc) {
|
||||||
|
|
Loading…
Reference in a new issue