mirror of
https://github.com/QM4RS/FridaBox.git
synced 2026-10-07 08:22:03 +02:00
feat: Enhance core framework with improved service faking, package management, and build system updates.
intigrated disable flag secure remove comments cleanup codes
This commit is contained in:
+1
-8
@@ -1,13 +1,6 @@
|
||||
package top.niunaijun.blackreflection;
|
||||
|
||||
/**
|
||||
* on 2022/2/16.
|
||||
* * ∧_∧
|
||||
* (`・ω・∥
|
||||
* 丶 つ0
|
||||
* しーJ
|
||||
* 此处无Bug
|
||||
*/
|
||||
|
||||
public class BlackNullPointerException extends NullPointerException {
|
||||
public BlackNullPointerException(String s) {
|
||||
super(s);
|
||||
|
||||
@@ -31,12 +31,12 @@ public class BlackReflection {
|
||||
private static final Map<Class<?>, Object> sProxyCache = new HashMap<>();
|
||||
private static final Map<Class<?>, Object> sProxyWithExceptionCache = new HashMap<>();
|
||||
|
||||
// key caller
|
||||
|
||||
private static final WeakHashMap<Object, Map<Class<?>, Object>> sCallerProxyCache = new WeakHashMap<>();
|
||||
|
||||
// public static <T> T create(Class<T> clazz, final Object caller) {
|
||||
// return create(clazz, caller, false);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
public static <T> T create(Class<T> clazz, final Object caller, boolean withException) {
|
||||
try {
|
||||
@@ -57,7 +57,7 @@ public class BlackReflection {
|
||||
|
||||
Object callerByWeak = isStatic ? null : weakCaller.get();
|
||||
|
||||
// fidel
|
||||
|
||||
BField bField = method.getAnnotation(BField.class);
|
||||
BFieldNotProcess bFieldNotProcess = method.getAnnotation(BFieldNotProcess.class);
|
||||
if (bField != null || bFieldNotProcess != null) {
|
||||
@@ -74,10 +74,10 @@ public class BlackReflection {
|
||||
return call;
|
||||
}
|
||||
|
||||
// void
|
||||
|
||||
BFieldSetNotProcess bFieldSetNotProcess = method.getAnnotation(BFieldSetNotProcess.class);
|
||||
if (bFieldSetNotProcess != null) {
|
||||
// startsWith "_set_"
|
||||
|
||||
name = name.substring("_set_".length());
|
||||
Reflector on = Reflector.on(aClass).field(name);
|
||||
if (isStatic) {
|
||||
@@ -91,10 +91,10 @@ public class BlackReflection {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// check field
|
||||
|
||||
BFieldCheckNotProcess bFieldCheckNotProcess = method.getAnnotation(BFieldCheckNotProcess.class);
|
||||
if (bFieldCheckNotProcess != null) {
|
||||
// startsWith "_check_"
|
||||
|
||||
name = name.substring("_check_".length());
|
||||
try {
|
||||
Reflector on = Reflector.on(aClass).field(name);
|
||||
@@ -106,10 +106,10 @@ public class BlackReflection {
|
||||
|
||||
Class<?>[] paramClass = getParamClass(method);
|
||||
|
||||
// check method
|
||||
|
||||
BMethodCheckNotProcess bMethodCheckNotProcess = method.getAnnotation(BMethodCheckNotProcess.class);
|
||||
if (bMethodCheckNotProcess != null) {
|
||||
// startsWith "_check_"
|
||||
|
||||
name = name.substring("_check_".length());
|
||||
try {
|
||||
return Reflector.on(aClass).method(name, paramClass).getMethod();
|
||||
@@ -118,7 +118,7 @@ public class BlackReflection {
|
||||
}
|
||||
}
|
||||
|
||||
// method
|
||||
|
||||
BConstructor bConstructor = method.getAnnotation(BConstructor.class);
|
||||
BConstructorNotProcess bConstructorNotProcess = method.getAnnotation(BConstructorNotProcess.class);
|
||||
if (bConstructor != null || bConstructorNotProcess != null) {
|
||||
|
||||
+1
-8
@@ -6,14 +6,7 @@ import java.lang.annotation.Target;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* on 2022/2/16.
|
||||
* * ∧_∧
|
||||
* (`・ω・∥
|
||||
* 丶 つ0
|
||||
* しーJ
|
||||
* 此处无Bug
|
||||
*/
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({METHOD})
|
||||
public @interface BConstructor {
|
||||
|
||||
+1
-8
@@ -6,14 +6,7 @@ import java.lang.annotation.Target;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* on 2022/2/16.
|
||||
* * ∧_∧
|
||||
* (`・ω・∥
|
||||
* 丶 つ0
|
||||
* しーJ
|
||||
* 此处无Bug
|
||||
*/
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({METHOD})
|
||||
public @interface BConstructorNotProcess {
|
||||
|
||||
@@ -4,14 +4,7 @@ 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);
|
||||
|
||||
@@ -126,7 +126,7 @@ public class Reflector {
|
||||
try {
|
||||
return cls.getDeclaredField(name);
|
||||
} catch (NoSuchFieldException ex) {
|
||||
// Ignored
|
||||
|
||||
}
|
||||
}
|
||||
throw e;
|
||||
@@ -186,7 +186,7 @@ public class Reflector {
|
||||
try {
|
||||
return cls.getDeclaredMethod(name, parameterTypes);
|
||||
} catch (NoSuchMethodException ex) {
|
||||
// Ignored
|
||||
|
||||
}
|
||||
}
|
||||
throw e;
|
||||
@@ -227,7 +227,7 @@ public class Reflector {
|
||||
cls = Class.forName(name, initialize, loader);
|
||||
return on(cls, null);
|
||||
} catch (Throwable e) {
|
||||
// Log.w(LOG_TAG, "Oops!", e);
|
||||
|
||||
return on(cls, e);
|
||||
}
|
||||
}
|
||||
@@ -276,7 +276,7 @@ public class Reflector {
|
||||
super.constructor(parameterTypes);
|
||||
} catch (Throwable e) {
|
||||
mIgnored = e;
|
||||
// Log.w(LOG_TAG, "Oops!", e);
|
||||
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -291,7 +291,7 @@ public class Reflector {
|
||||
return super.newInstance(initargs);
|
||||
} catch (Throwable e) {
|
||||
mIgnored = e;
|
||||
// Log.w(LOG_TAG, "Oops!", e);
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -306,7 +306,7 @@ public class Reflector {
|
||||
super.bind(obj);
|
||||
} catch (Throwable e) {
|
||||
mIgnored = e;
|
||||
// Log.w(LOG_TAG, "Oops!", e);
|
||||
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -327,7 +327,7 @@ public class Reflector {
|
||||
super.field(name);
|
||||
} catch (Throwable e) {
|
||||
mIgnored = e;
|
||||
// Log.w(LOG_TAG, "Oops!", e);
|
||||
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -342,7 +342,7 @@ public class Reflector {
|
||||
return super.get();
|
||||
} catch (Throwable e) {
|
||||
mIgnored = e;
|
||||
// Log.w(LOG_TAG, "Oops!", e);
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -357,7 +357,7 @@ public class Reflector {
|
||||
return super.get(caller);
|
||||
} catch (Throwable e) {
|
||||
mIgnored = e;
|
||||
// Log.w(LOG_TAG, "Oops!", e);
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -372,7 +372,7 @@ public class Reflector {
|
||||
super.set(value);
|
||||
} catch (Throwable e) {
|
||||
mIgnored = e;
|
||||
// Log.w(LOG_TAG, "Oops!", e);
|
||||
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -387,7 +387,7 @@ public class Reflector {
|
||||
super.set(caller, value);
|
||||
} catch (Throwable e) {
|
||||
mIgnored = e;
|
||||
// Log.w(LOG_TAG, "Oops!", e);
|
||||
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -402,7 +402,7 @@ public class Reflector {
|
||||
super.method(name, parameterTypes);
|
||||
} catch (Throwable e) {
|
||||
mIgnored = e;
|
||||
// Log.w(LOG_TAG, "Oops!", e);
|
||||
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -417,7 +417,7 @@ public class Reflector {
|
||||
return super.call(args);
|
||||
} catch (Throwable e) {
|
||||
mIgnored = e;
|
||||
// Log.w(LOG_TAG, "Oops!", e);
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -432,7 +432,7 @@ public class Reflector {
|
||||
return super.callByCaller(caller, args);
|
||||
} catch (Throwable e) {
|
||||
mIgnored = e;
|
||||
// Log.w(LOG_TAG, "Oops!", e);
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user