Commit bd6e59e9 authored by Administrator's avatar Administrator

fix

parent 3719a922
...@@ -117,31 +117,27 @@ public class JustTrustMe { ...@@ -117,31 +117,27 @@ public class JustTrustMe {
} }
} }
private static boolean hasAndroidRootTrustManager = false;
private static void trustAndroidRootTrustManager() { private static void trustAndroidRootTrustManager() {
Class<?> rootTrustManagerClass;
try { try {
Class.forName("android.security.net.config.RootTrustManager", false, RatelToolKit.hostClassLoader); rootTrustManagerClass = ClassLoader.getSystemClassLoader().loadClass("android.security.net.config.RootTrustManager");
} catch (Throwable throwable) { } catch (Throwable throwable) {
return; return;
} }
hasAndroidRootTrustManager = true;
hookIfClassExist("android.security.net.config.RootTrustManager", new ClassExistEvent() { for (Method method : rootTrustManagerClass.getDeclaredMethods()) {
@Override if (method.getName().equals("checkServerTrusted")
public void onClassFind(Class clazz) { && method.getReturnType().equals(Void.TYPE)) {
for (Method method : clazz.getDeclaredMethods()) { RposedBridge.hookMethod(method, new RC_MethodReplacement() {
if (method.getName().equals("checkServerTrusted") @Override
&& method.getReturnType().equals(Void.class)) { protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
RposedBridge.hookMethod(method, new RC_MethodReplacement() { Log.i("weijia", "checkServerTrusted", new Throwable());
@Override return null;
protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
return null;
}
});
} }
} });
} }
}); }
} }
private static void trustApache() { 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