Skip to content

Commit dc1c1a4

Browse files
authored
Merge pull request Fuzion24#54 from Curz0n/master
Add support for OkHttp4.2.0+
2 parents 01f277f + 61de032 commit dc1c1a4

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,28 @@ protected Object replaceHookedMethod(MethodHookParam methodHookParam) throws Thr
502502
Log.d(TAG, "OKHTTP 3.x not found in " + currentPackageName + " -- not hooking OkHostnameVerifier.verify(String, X509)(");
503503
// pass
504504
}
505+
506+
//https://github.com/square/okhttp/blob/okhttp_4.2.x/okhttp/src/main/java/okhttp3/CertificatePinner.kt
507+
Log.d(TAG, "Hooking okhttp3.CertificatePinner.check(String,List) (4.2.0+) for: " + currentPackageName);
508+
509+
try {
510+
classLoader.loadClass("okhttp3.CertificatePinner");
511+
findAndHookMethod("okhttp3.CertificatePinner",
512+
classLoader,
513+
"check$okhttp",
514+
String.class,
515+
"kotlin.jvm.functions.Function0",
516+
new XC_MethodReplacement() {
517+
@Override
518+
protected Object replaceHookedMethod(MethodHookParam methodHookParam) throws Throwable {
519+
return null;
520+
}
521+
});
522+
} catch (ClassNotFoundException e) {
523+
Log.d(TAG, "OKHTTP 4.2.0+ not found in " + currentPackageName + " -- not hooking");
524+
// pass
525+
}
526+
505527
}
506528

507529
void processHttpClientAndroidLib(ClassLoader classLoader) {

0 commit comments

Comments
 (0)