正在查看: CallApp v2.226 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: CallApp v2.226 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.mbridge.msdk.thrid.okhttp.internal.platform;
import android.os.Build;
import android.util.Log;
import com.mbridge.msdk.thrid.okhttp.u;
import com.unity3d.services.core.fid.Constants;
import com.vungle.ads.internal.protos.Sdk$SDKError;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
import java.security.cert.Certificate;
import java.security.cert.TrustAnchor;
import java.security.cert.X509Certificate;
import java.util.List;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.X509TrustManager;
class b extends g {
private final Class<?> c;
private final f<Socket> d;
private final f<Socket> e;
private final f<Socket> f;
private final f<Socket> g;
private final c h = c.a();
public static final class a extends com.mbridge.msdk.thrid.okhttp.internal.tls.c {
private final Object a;
private final Method b;
public a(Object obj, Method method) {
this.a = obj;
this.b = method;
}
@Override
public List<Certificate> a(List<Certificate> list, String str) throws SSLPeerUnverifiedException {
try {
return (List) this.b.invoke(this.a, (X509Certificate[]) list.toArray(new X509Certificate[list.size()]), "RSA", str);
} catch (IllegalAccessException e) {
throw new AssertionError(e);
} catch (InvocationTargetException e2) {
SSLPeerUnverifiedException sSLPeerUnverifiedException = new SSLPeerUnverifiedException(e2.getMessage());
sSLPeerUnverifiedException.initCause(e2);
throw sSLPeerUnverifiedException;
}
}
public boolean equals(Object obj) {
return obj instanceof a;
}
public int hashCode() {
return 0;
}
}
public static final class C0032b implements com.mbridge.msdk.thrid.okhttp.internal.tls.e {
private final X509TrustManager a;
private final Method b;
public C0032b(X509TrustManager x509TrustManager, Method method) {
this.b = method;
this.a = x509TrustManager;
}
@Override
public X509Certificate a(X509Certificate x509Certificate) {
try {
TrustAnchor trustAnchor = (TrustAnchor) this.b.invoke(this.a, x509Certificate);
if (trustAnchor != null) {
return trustAnchor.getTrustedCert();
}
} catch (IllegalAccessException e) {
throw com.mbridge.msdk.thrid.okhttp.internal.c.a("unable to get issues and signature", (Exception) e);
} catch (InvocationTargetException unused) {
}
return null;
}
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof C0032b)) {
return false;
}
C0032b c0032b = (C0032b) obj;
return this.a.equals(c0032b.a) && this.b.equals(c0032b.b);
}
public int hashCode() {
return (this.b.hashCode() * 31) + this.a.hashCode();
}
}
public b(Class<?> cls, f<Socket> fVar, f<Socket> fVar2, f<Socket> fVar3, f<Socket> fVar4) {
this.c = cls;
this.d = fVar;
this.e = fVar2;
this.f = fVar3;
this.g = fVar4;
}
public static g h() {
Class<?> cls;
f fVar;
f fVar2;
try {
if (!g.f()) {
return null;
}
try {
cls = Class.forName("com.android.org.conscrypt.SSLParametersImpl");
} catch (ClassNotFoundException unused) {
cls = Class.forName("org.apache.harmony.xnet.provider.jsse.SSLParametersImpl");
}
Class<?> cls2 = cls;
f fVar3 = new f(null, "setUseSessionTickets", Boolean.TYPE);
f fVar4 = new f(null, "setHostname", String.class);
if (j()) {
fVar = new f(byte[].class, "getAlpnSelectedProtocol", new Class[0]);
fVar2 = new f(null, "setAlpnProtocols", byte[].class);
} else {
fVar = null;
fVar2 = null;
}
return new b(cls2, fVar3, fVar4, fVar, fVar2);
} catch (ClassNotFoundException unused2) {
return null;
}
}
public static int i() {
try {
return Build.VERSION.SDK_INT;
} catch (NoClassDefFoundError unused) {
return 0;
}
}
private static boolean j() {
if (Security.getProvider("GMSCore_OpenSSL") != null) {
return true;
}
try {
Class.forName("android.net.Network");
return true;
} catch (ClassNotFoundException unused) {
return false;
}
}
@Override
public void a(Socket socket, InetSocketAddress inetSocketAddress, int i) throws IOException {
try {
socket.connect(inetSocketAddress, i);
} catch (AssertionError e) {
if (!com.mbridge.msdk.thrid.okhttp.internal.c.a(e)) {
throw e;
}
throw new IOException(e);
} catch (ClassCastException e2) {
if (Build.VERSION.SDK_INT != 26) {
throw e2;
}
IOException iOException = new IOException("Exception in connect");
iOException.initCause(e2);
throw iOException;
} catch (SecurityException e3) {
IOException iOException2 = new IOException("Exception in connect");
iOException2.initCause(e3);
throw iOException2;
}
}
@Override
public String b(SSLSocket sSLSocket) {
byte[] bArr;
f<Socket> fVar = this.f;
if (fVar == null || !fVar.a((f<Socket>) sSLSocket) || (bArr = (byte[]) this.f.d(sSLSocket, new Object[0])) == null) {
return null;
}
return new String(bArr, com.mbridge.msdk.thrid.okhttp.internal.c.j);
}
@Override
public SSLContext e() {
try {
return SSLContext.getInstance("TLS");
} catch (NoSuchAlgorithmException e) {
throw new IllegalStateException("No TLS provider", e);
}
}
public static final class c {
private final Method a;
private final Method b;
private final Method c;
public c(Method method, Method method2, Method method3) {
this.a = method;
this.b = method2;
this.c = method3;
}
public Object a(String str) {
Method method = this.a;
if (method != null) {
try {
Object invoke = method.invoke(null, null);
this.b.invoke(invoke, str);
return invoke;
} catch (Exception unused) {
}
}
return null;
}
public boolean a(Object obj) {
if (obj == null) {
return false;
}
try {
this.c.invoke(obj, null);
return true;
} catch (Exception unused) {
return false;
}
}
public static c a() {
Method method;
Method method2;
Method method3 = null;
try {
Class<?> cls = Class.forName("dalvik.system.CloseGuard");
Method method4 = cls.getMethod("get", null);
method2 = cls.getMethod("open", String.class);
method = cls.getMethod("warnIfOpen", null);
method3 = method4;
} catch (Exception unused) {
method = null;
method2 = null;
}
return new c(method3, method2, method);
}
}
@Override
public boolean b(String str) {
try {
Class<?> cls = Class.forName("android.security.NetworkSecurityPolicy");
return b(str, cls, cls.getMethod(Constants.GET_INSTANCE, null).invoke(null, null));
} catch (ClassNotFoundException | NoSuchMethodException unused) {
return super.b(str);
} catch (IllegalAccessException e) {
e = e;
throw com.mbridge.msdk.thrid.okhttp.internal.c.a("unable to determine cleartext support", e);
} catch (IllegalArgumentException e2) {
e = e2;
throw com.mbridge.msdk.thrid.okhttp.internal.c.a("unable to determine cleartext support", e);
} catch (InvocationTargetException e3) {
e = e3;
throw com.mbridge.msdk.thrid.okhttp.internal.c.a("unable to determine cleartext support", e);
}
}
private boolean b(String str, Class<?> cls, Object obj) throws InvocationTargetException, IllegalAccessException {
try {
return ((Boolean) cls.getMethod("isCleartextTrafficPermitted", String.class).invoke(obj, str)).booleanValue();
} catch (NoSuchMethodException unused) {
return a(str, cls, obj);
}
}
@Override
public void a(SSLSocket sSLSocket, String str, List<u> list) throws IOException {
if (str != null) {
this.d.c(sSLSocket, Boolean.TRUE);
this.e.c(sSLSocket, str);
}
f<Socket> fVar = this.g;
if (fVar == null || !fVar.a((f<Socket>) sSLSocket)) {
return;
}
this.g.d(sSLSocket, g.b(list));
}
@Override
public com.mbridge.msdk.thrid.okhttp.internal.tls.e b(X509TrustManager x509TrustManager) {
try {
Method declaredMethod = x509TrustManager.getClass().getDeclaredMethod("findTrustAnchorByIssuerAndSignature", X509Certificate.class);
declaredMethod.setAccessible(true);
return new C0032b(x509TrustManager, declaredMethod);
} catch (NoSuchMethodException unused) {
return super.b(x509TrustManager);
}
}
@Override
public void a(int i, String str, Throwable th) {
int min;
int i2 = i != 5 ? 3 : 5;
if (th != null) {
str = str + '\n' + Log.getStackTraceString(th);
}
int length = str.length();
int i3 = 0;
while (i3 < length) {
int indexOf = str.indexOf(10, i3);
if (indexOf == -1) {
indexOf = length;
}
while (true) {
min = Math.min(indexOf, i3 + Sdk$SDKError.b.VUNGLE_OIT_CREATION_ERROR_VALUE);
Log.println(i2, "OkHttp", str.substring(i3, min));
if (min >= indexOf) {
break;
} else {
i3 = min;
}
}
i3 = min + 1;
}
}
@Override
public Object a(String str) {
return this.h.a(str);
}
@Override
public void a(String str, Object obj) {
if (this.h.a(obj)) {
return;
}
a(5, str, (Throwable) null);
}
private boolean a(String str, Class<?> cls, Object obj) throws InvocationTargetException, IllegalAccessException {
try {
return ((Boolean) cls.getMethod("isCleartextTrafficPermitted", null).invoke(obj, null)).booleanValue();
} catch (NoSuchMethodException unused) {
return super.b(str);
}
}
@Override
public com.mbridge.msdk.thrid.okhttp.internal.tls.c a(X509TrustManager x509TrustManager) {
try {
Class<?> cls = Class.forName("android.net.http.X509TrustManagerExtensions");
return new a(cls.getConstructor(X509TrustManager.class).newInstance(x509TrustManager), cls.getMethod("checkServerTrusted", X509Certificate[].class, String.class, String.class));
} catch (Exception unused) {
return super.a(x509TrustManager);
}
}
}