Skip to content

Commit

Permalink
Add support for OkHttp4.2.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
Curz0n committed Aug 15, 2020
1 parent 01f277f commit 61de032
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions app/src/main/java/just/trust/me/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,28 @@ protected Object replaceHookedMethod(MethodHookParam methodHookParam) throws Thr
Log.d(TAG, "OKHTTP 3.x not found in " + currentPackageName + " -- not hooking OkHostnameVerifier.verify(String, X509)(");
// pass
}

//https://github.com/square/okhttp/blob/okhttp_4.2.x/okhttp/src/main/java/okhttp3/CertificatePinner.kt
Log.d(TAG, "Hooking okhttp3.CertificatePinner.check(String,List) (4.2.0+) for: " + currentPackageName);

try {
classLoader.loadClass("okhttp3.CertificatePinner");
findAndHookMethod("okhttp3.CertificatePinner",
classLoader,
"check$okhttp",
String.class,
"kotlin.jvm.functions.Function0",
new XC_MethodReplacement() {
@Override
protected Object replaceHookedMethod(MethodHookParam methodHookParam) throws Throwable {
return null;
}
});
} catch (ClassNotFoundException e) {
Log.d(TAG, "OKHTTP 4.2.0+ not found in " + currentPackageName + " -- not hooking");
// pass
}

}

void processHttpClientAndroidLib(ClassLoader classLoader) {
Expand Down

0 comments on commit 61de032

Please sign in to comment.