mirror of
https://github.com/QM4RS/FridaBox.git
synced 2026-10-01 05:22:24 +02:00
feat: Introduce black-reflection and compiler modules, integrate reflection utilities, and update core components.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package top.niunaijun.blackreflection.utils;
|
||||
|
||||
import top.niunaijun.blackreflection.annotation.BClass;
|
||||
import top.niunaijun.blackreflection.annotation.BClassName;
|
||||
import top.niunaijun.blackreflection.annotation.BClassNameNotProcess;
|
||||
|
||||
/**
|
||||
* on 2022/2/18.
|
||||
* * ∧_∧
|
||||
* (`・ω・∥
|
||||
* 丶 つ0
|
||||
* しーJ
|
||||
* 此处无Bug
|
||||
*/
|
||||
public class ClassUtil {
|
||||
public static Class<?> classReady(Class<?> clazz) {
|
||||
BClassNameNotProcess bClassNameNotProcess = clazz.getAnnotation(BClassNameNotProcess.class);
|
||||
if (bClassNameNotProcess != null) {
|
||||
return classReady(bClassNameNotProcess.value());
|
||||
}
|
||||
BClass annotation = clazz.getAnnotation(BClass.class);
|
||||
if (annotation != null) {
|
||||
return annotation.value();
|
||||
}
|
||||
BClassName bClassName = clazz.getAnnotation(BClassName.class);
|
||||
if (bClassName != null) {
|
||||
return classReady(bClassName.value());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Class<?> classReady(String clazz) {
|
||||
try {
|
||||
return Class.forName(clazz);
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user