MD5 校验值:8005b9444b02324a81f85f1ef7e26f28
j.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package kb; import com.adadapted.android.sdk.core.intercept.InterceptEvent; import java.io.EOFException; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.net.Socket; import java.security.AccessController; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.PrivilegedActionException; import java.security.Provider; import java.security.Security; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLParameters; import javax.net.ssl.SSLSocket; public class j { public static final Logger f8596b = Logger.getLogger(j.class.getName()); public static final String[] f8597c = {"com.google.android.gms.org.conscrypt.OpenSSLProvider", "org.conscrypt.OpenSSLProvider", "com.android.org.conscrypt.OpenSSLProvider", "org.apache.harmony.xnet.provider.jsse.OpenSSLProvider", "com.google.android.libraries.stitch.sslguard.SslGuardProvider"}; public static final j f8598d; public final Provider f8599a; public static class a extends j { public final f<Socket> f8600e; public final f<Socket> f8601f; public final f<Socket> f8602g; public final f<Socket> f8603h; public final int f8604i; public a(f fVar, f fVar2, f fVar3, f fVar4, Provider provider, int i10) { super(provider); this.f8600e = fVar; this.f8601f = fVar2; this.f8602g = fVar3; this.f8603h = fVar4; this.f8604i = i10; } @Override public final void c(SSLSocket sSLSocket, String str, List<k> list) { boolean z10; if (str != null) { this.f8600e.d(sSLSocket, Boolean.TRUE); this.f8601f.d(sSLSocket, str); } f<Socket> fVar = this.f8603h; fVar.getClass(); if (fVar.a(sSLSocket.getClass()) != null) { z10 = true; } else { z10 = false; } if (z10) { this.f8603h.e(sSLSocket, j.b(list)); } } @Override public final String d(SSLSocket sSLSocket) { boolean z10; byte[] bArr; f<Socket> fVar = this.f8602g; fVar.getClass(); if (fVar.a(sSLSocket.getClass()) != null) { z10 = true; } else { z10 = false; } if (!z10 || (bArr = (byte[]) this.f8602g.e(sSLSocket, new Object[0])) == null) { return null; } return new String(bArr, n.f8630b); } @Override public final int e() { return this.f8604i; } } public static class b extends j { public final Method f8605e; public final Method f8606f; public b(Provider provider, Method method, Method method2) { super(provider); this.f8605e = method; this.f8606f = method2; } @Override public final void c(SSLSocket sSLSocket, String str, List<k> list) { SSLParameters sSLParameters = sSLSocket.getSSLParameters(); ArrayList arrayList = new ArrayList(list.size()); for (k kVar : list) { if (kVar != k.HTTP_1_0) { arrayList.add(kVar.f8619s); } } try { this.f8605e.invoke(sSLParameters, arrayList.toArray(new String[arrayList.size()])); sSLSocket.setSSLParameters(sSLParameters); } catch (IllegalAccessException e10) { throw new RuntimeException(e10); } catch (InvocationTargetException e11) { throw new RuntimeException(e11); } } @Override public final String d(SSLSocket sSLSocket) { try { return (String) this.f8606f.invoke(sSLSocket, new Object[0]); } catch (IllegalAccessException e10) { throw new RuntimeException(e10); } catch (InvocationTargetException e11) { throw new RuntimeException(e11); } } @Override public final int e() { return 1; } } public static class c extends j { public final Method f8607e; public final Method f8608f; public final Method f8609g; public final Class<?> f8610h; public final Class<?> f8611i; public c(Method method, Method method2, Method method3, Class<?> cls, Class<?> cls2, Provider provider) { super(provider); this.f8607e = method; this.f8608f = method2; this.f8609g = method3; this.f8610h = cls; this.f8611i = cls2; } @Override public final void a(SSLSocket sSLSocket) { try { this.f8609g.invoke(null, sSLSocket); } catch (IllegalAccessException unused) { throw new AssertionError(); } catch (InvocationTargetException e10) { j.f8596b.log(Level.FINE, "Failed to remove SSLSocket from Jetty ALPN", (Throwable) e10); } } @Override public final void c(SSLSocket sSLSocket, String str, List<k> list) { ArrayList arrayList = new ArrayList(list.size()); int size = list.size(); for (int i10 = 0; i10 < size; i10++) { k kVar = list.get(i10); if (kVar != k.HTTP_1_0) { arrayList.add(kVar.f8619s); } } try { this.f8607e.invoke(null, sSLSocket, Proxy.newProxyInstance(j.class.getClassLoader(), new Class[]{this.f8610h, this.f8611i}, new d(arrayList))); } catch (IllegalAccessException e10) { throw new AssertionError(e10); } catch (InvocationTargetException e11) { throw new AssertionError(e11); } } @Override public final String d(SSLSocket sSLSocket) { try { d dVar = (d) Proxy.getInvocationHandler(this.f8608f.invoke(null, sSLSocket)); boolean z10 = dVar.f8613b; if (!z10 && dVar.f8614c == null) { j.f8596b.log(Level.INFO, "ALPN callback dropped: SPDY and HTTP/2 are disabled. Is alpn-boot on the boot class path?"); return null; } if (z10) { return null; } return dVar.f8614c; } catch (IllegalAccessException unused) { throw new AssertionError(); } catch (InvocationTargetException unused2) { throw new AssertionError(); } } @Override public final int e() { return 1; } } public static class d implements InvocationHandler { public final List<String> f8612a; public boolean f8613b; public String f8614c; public d(ArrayList arrayList) { this.f8612a = arrayList; } @Override public final Object invoke(Object obj, Method method, Object[] objArr) throws Throwable { String name = method.getName(); Class<?> returnType = method.getReturnType(); if (objArr == null) { objArr = n.f8629a; } if (name.equals("supports") && Boolean.TYPE == returnType) { return Boolean.TRUE; } if (name.equals("unsupported") && Void.TYPE == returnType) { this.f8613b = true; return null; } if (name.equals("protocols") && objArr.length == 0) { return this.f8612a; } if ((name.equals("selectProtocol") || name.equals("select")) && String.class == returnType && objArr.length == 1) { Object obj2 = objArr[0]; if (obj2 instanceof List) { List list = (List) obj2; int size = list.size(); for (int i10 = 0; i10 < size; i10++) { if (this.f8612a.contains(list.get(i10))) { String str = (String) list.get(i10); this.f8614c = str; return str; } } String str2 = this.f8612a.get(0); this.f8614c = str2; return str2; } } if ((name.equals("protocolSelected") || name.equals(InterceptEvent.SELECTED)) && objArr.length == 1) { this.f8614c = (String) objArr[0]; return null; } return method.invoke(this, objArr); } } static { Provider provider; j jVar; j jVar2; int i10; boolean z10; Provider[] providers = Security.getProviders(); int length = providers.length; boolean z11 = false; int i11 = 0; loop0: while (true) { if (i11 < length) { Provider provider2 = providers[i11]; for (String str : f8597c) { if (str.equals(provider2.getClass().getName())) { f8596b.log(Level.FINE, "Found registered provider {0}", str); provider = provider2; break loop0; } } i11++; } else { f8596b.log(Level.WARNING, "Unable to find Conscrypt"); provider = null; break; } } if (provider != null) { f fVar = new f(null, "setUseSessionTickets", Boolean.TYPE); f fVar2 = new f(null, "setHostname", String.class); f fVar3 = new f(byte[].class, "getAlpnSelectedProtocol", new Class[0]); f fVar4 = new f(null, "setAlpnProtocols", byte[].class); try { Class<?> cls = Class.forName("android.net.TrafficStats"); cls.getMethod("tagSocket", Socket.class); cls.getMethod("untagSocket", Socket.class); } catch (ClassNotFoundException | NoSuchMethodException unused) { } if (!provider.getName().equals("GmsCore_OpenSSL") && !provider.getName().equals("Conscrypt") && !provider.getName().equals("Ssl_Guard")) { try { j.class.getClassLoader().loadClass("android.net.Network"); z10 = true; } catch (ClassNotFoundException e10) { f8596b.log(Level.FINE, "Can't find class", (Throwable) e10); z10 = false; } if (!z10) { try { j.class.getClassLoader().loadClass("android.app.ActivityOptions"); z11 = true; } catch (ClassNotFoundException e11) { f8596b.log(Level.FINE, "Can't find class", (Throwable) e11); } if (z11) { i10 = 2; } else { i10 = 3; } jVar2 = new a(fVar, fVar2, fVar3, fVar4, provider, i10); } } i10 = 1; jVar2 = new a(fVar, fVar2, fVar3, fVar4, provider, i10); } else { try { Provider provider3 = SSLContext.getDefault().getProvider(); try { SSLContext sSLContext = SSLContext.getInstance("TLS", provider3); sSLContext.init(null, null, null); ((Method) AccessController.doPrivileged(new g())).invoke(sSLContext.createSSLEngine(), new Object[0]); jVar2 = new b(provider3, (Method) AccessController.doPrivileged(new h()), (Method) AccessController.doPrivileged(new i())); } catch (IllegalAccessException | InvocationTargetException | KeyManagementException | NoSuchAlgorithmException | PrivilegedActionException unused2) { try { Class<?> cls2 = Class.forName("org.eclipse.jetty.alpn.ALPN"); jVar = new c(cls2.getMethod("put", SSLSocket.class, Class.forName("org.eclipse.jetty.alpn.ALPN$Provider")), cls2.getMethod("get", SSLSocket.class), cls2.getMethod("remove", SSLSocket.class), Class.forName("org.eclipse.jetty.alpn.ALPN$ClientProvider"), Class.forName("org.eclipse.jetty.alpn.ALPN$ServerProvider"), provider3); } catch (ClassNotFoundException | NoSuchMethodException unused3) { jVar = new j(provider3); } jVar2 = jVar; } } catch (NoSuchAlgorithmException e12) { throw new RuntimeException(e12); } } f8598d = jVar2; } public j(Provider provider) { this.f8599a = provider; } public static byte[] b(List<k> list) { yc.d dVar = new yc.d(); int size = list.size(); for (int i10 = 0; i10 < size; i10++) { k kVar = list.get(i10); if (kVar != k.HTTP_1_0) { dVar.x(kVar.f8619s.length()); String str = kVar.f8619s; dVar.N(str, 0, str.length()); } } try { return dVar.h(dVar.f23885t); } catch (EOFException e10) { throw new AssertionError(e10); } } public void a(SSLSocket sSLSocket) { } public void c(SSLSocket sSLSocket, String str, List<k> list) { } public String d(SSLSocket sSLSocket) { return null; } public int e() { return 3; } }