Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2020
3,574
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Remove certificate pinning
  3.  */
  4. if (Java.available) {
  5.   console.log('[*] unpin.js - Java is available');
  6.   Java.perform(function () {
  7.     console.log('[*] unpin.js - Performing Java operation');
  8.     var array_list = Java.use("java.util.ArrayList");
  9.     var ApiClient = Java.use('com.android.org.conscrypt.TrustManagerImpl');
  10.     ApiClient.checkTrustedRecursive.implementation = function (a1, a2, a3, a4, a5, a6) {
  11.       var k = array_list.$new();
  12.       return k;
  13.     };
  14.  
  15.     /**
  16.      * Java url proxy shit doesn't let us use proxies if they do this:
  17.      * v6 = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
  18.      * java.net.URL.openConnection(java.net.Proxy)
  19.      */
  20.     var URL = Java.use('java.net.URL');
  21.     URL.openConnection.overload('java.net.Proxy').implementation = function (proxyType) {
  22.       console.log('Attempting to open connection with proxyType', proxyType);
  23.       return this.openConnection() // (proxyType);
  24.     };
  25.  
  26.     var HttpsURLConnection = Java.use("javax.net.ssl.HttpsURLConnection");
  27.     HttpsURLConnection.setDefaultHostnameVerifier.implementation = function (hostnameVerifier) {
  28.       console.log("HttpsURLConnection.setDefaultHostnameVerifier invoked");
  29.       return null;
  30.     };
  31.     /* libcore/luni/src/main/java/javax/net/ssl/HttpsURLConnection.java */
  32.     /* public void setSSLSocketFactory(SSLSocketFactory) */
  33.     HttpsURLConnection.setSSLSocketFactory.implementation = function (SSLSocketFactory) {
  34.       console.log("HttpsURLConnection.setSSLSocketFactory invoked");
  35.       return null;
  36.     };
  37.     /* libcore/luni/src/main/java/javax/net/ssl/HttpsURLConnection.java */
  38.     /* public void setHostnameVerifier(HostnameVerifier) */
  39.     HttpsURLConnection.setHostnameVerifier.implementation = function (hostnameVerifier) {
  40.       console.log("HttpsURLConnection.setHostnameVerifier invoked");
  41.       return null;
  42.     };
  43.  
  44.     var AppLog = Java.use('com.ss.android.common.applog.AppLog');
  45.     AppLog.packString.implementation = function(str) {
  46.         var out = this.packString(str);
  47.         console.log('[packString Called]', str, 'Result:', out);
  48.         return out;
  49.     };
  50.  
  51.   });
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement