Skip to content

Commit 152557d

Browse files
authored
Merge pull request Fuzion24#55 from MagicWizz/patch-1
Add other function to bypass
2 parents dc1c1a4 + f0aaebf commit 152557d

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

app/src/main/java/just/trust/me/Main.java

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.content.Context;
44
import android.net.http.SslError;
5+
import android.net.http.X509TrustManagerExtensions;
56
import android.util.Log;
67
import android.webkit.SslErrorHandler;
78
import android.webkit.WebView;
@@ -34,6 +35,7 @@
3435
import javax.net.ssl.HostnameVerifier;
3536
import javax.net.ssl.KeyManager;
3637
import javax.net.ssl.SSLContext;
38+
import javax.net.ssl.SSLParameters;
3739
import javax.net.ssl.SSLSession;
3840
import javax.net.ssl.TrustManager;
3941
import javax.net.ssl.X509TrustManager;
@@ -102,6 +104,20 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
102104
}
103105
});
104106

107+
findAndHookMethod(X509TrustManagerExtensions.class, "checkServerTrusted", X509Certificate[].class, String.class, String.class, new XC_MethodReplacement() {
108+
@Override
109+
protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
110+
return param.args[0];
111+
}
112+
});
113+
114+
findAndHookMethod("android.security.net.config.NetworkSecurityTrustManager", lpparam.classLoader, "checkPins", List.class, new XC_MethodReplacement() {
115+
@Override
116+
protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
117+
return null;
118+
}
119+
});
120+
105121
/* external/apache-http/src/org/apache/http/conn/ssl/SSLSocketFactory.java */
106122
/* public SSLSocketFactory( ... ) */
107123
Log.d(TAG, "Hooking SSLSocketFactory(String, KeyStore, String, KeyStore) for: " + currentPackageName);
@@ -303,6 +319,23 @@ protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
303319
return list;
304320
}
305321
});
322+
323+
findAndHookMethod("com.android.org.conscrypt.TrustManagerImpl", lpparam.classLoader, "checkTrusted", X509Certificate[].class, String.class, SSLSession.class, SSLParameters.class, boolean.class, new XC_MethodReplacement() {
324+
@Override
325+
protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
326+
ArrayList<X509Certificate> list = new ArrayList<X509Certificate>();
327+
return list;
328+
}
329+
});
330+
331+
332+
findAndHookMethod("com.android.org.conscrypt.TrustManagerImpl", lpparam.classLoader, "checkTrusted", X509Certificate[].class, byte[].class, byte[].class, String.class, String.class, boolean.class, new XC_MethodReplacement() {
333+
@Override
334+
protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
335+
ArrayList<X509Certificate> list = new ArrayList<X509Certificate>();
336+
return list;
337+
}
338+
});
306339
}
307340

308341
} // End Hooks
@@ -556,10 +589,10 @@ public void checkClientTrusted(X509Certificate[] chain, String authType) throws
556589
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
557590
}
558591

559-
public List<X509Certificate> checkServerTrusted(X509Certificate[] chain, String authType, String host) throws CertificateException {
560-
ArrayList<X509Certificate> list = new ArrayList<X509Certificate>();
561-
return list;
562-
}
592+
public List<X509Certificate> checkServerTrusted(X509Certificate[] chain, String authType, String host) throws CertificateException {
593+
ArrayList<X509Certificate> list = new ArrayList<X509Certificate>();
594+
return list;
595+
}
563596

564597
@Override
565598
public X509Certificate[] getAcceptedIssuers() {

0 commit comments

Comments
 (0)