Skip to content

Commit

Permalink
Additional TrustManagerImpl changes for older devices
Browse files Browse the repository at this point in the history
  • Loading branch information
jakev committed Nov 5, 2015
1 parent 862716f commit b03a283
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/src/main/java/just/trust/me/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,17 @@ protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
/* JSSE Hooks */
/* libcore/luni/src/main/java/javax/net/ssl/TrustManagerFactory.java */
/* public final TrustManager[] getTrustManager() */
findAndHookMethod("javax.net.ssl.TrustManagerFactory", lpparam.classLoader, "getTrustManagers", new XC_MethodHook() {
findAndHookMethod("javax.net.ssl.TrustManagerFactory", lpparam.classLoader, "getTrustManagers", new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Class<?> cls = findClass("com.android.org.conscrypt.TrustManagerImpl", lpparam.classLoader);

TrustManager[] managers = (TrustManager[])param.getResult();
if(managers.length > 0 && cls.isInstance(managers[0]))
return;
if (hasTrustManagerImpl()) {
Class<?> cls = findClass("com.android.org.conscrypt.TrustManagerImpl", lpparam.classLoader);

TrustManager[] managers = (TrustManager[])param.getResult();
if(managers.length > 0 && cls.isInstance(managers[0]))
return;
}

param.setResult(new TrustManager[]{new ImSureItsLegitTrustManager()});
}
Expand Down
Binary file modified bin/JustTrustMe.apk
Binary file not shown.

0 comments on commit b03a283

Please sign in to comment.