Commit bd6e59e9 authored by Administrator's avatar Administrator

fix

parent 3719a922
......@@ -117,31 +117,27 @@ public class JustTrustMe {
}
}
private static boolean hasAndroidRootTrustManager = false;
private static void trustAndroidRootTrustManager() {
Class<?> rootTrustManagerClass;
try {
Class.forName("android.security.net.config.RootTrustManager", false, RatelToolKit.hostClassLoader);
rootTrustManagerClass = ClassLoader.getSystemClassLoader().loadClass("android.security.net.config.RootTrustManager");
} catch (Throwable throwable) {
return;
}
hasAndroidRootTrustManager = true;
hookIfClassExist("android.security.net.config.RootTrustManager", new ClassExistEvent() {
@Override
public void onClassFind(Class clazz) {
for (Method method : clazz.getDeclaredMethods()) {
if (method.getName().equals("checkServerTrusted")
&& method.getReturnType().equals(Void.class)) {
RposedBridge.hookMethod(method, new RC_MethodReplacement() {
@Override
protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
return null;
}
});
for (Method method : rootTrustManagerClass.getDeclaredMethods()) {
if (method.getName().equals("checkServerTrusted")
&& method.getReturnType().equals(Void.TYPE)) {
RposedBridge.hookMethod(method, new RC_MethodReplacement() {
@Override
protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
Log.i("weijia", "checkServerTrusted", new Throwable());
return null;
}
}
});
}
});
}
}
private static void trustApache() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment