MD5 校验值:5ef3f775189f42f146cf0788a99eebd7
g.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package ab; import com.squareup.okhttp.Protocol; import java.io.IOException; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.net.InetSocketAddress; import java.net.Socket; import java.net.SocketException; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; import javax.net.ssl.SSLSocket; import okio.Buffer; public class g { private static final g f152a = e(); public static class a extends g { private final f<Socket> f153b; private final f<Socket> f154c; private final Method f155d; private final Method f156e; private final f<Socket> f157f; private final f<Socket> f158g; public a(f<Socket> fVar, f<Socket> fVar2, Method method, Method method2, f<Socket> fVar3, f<Socket> fVar4) { this.f153b = fVar; this.f154c = fVar2; this.f155d = method; this.f156e = method2; this.f157f = fVar3; this.f158g = fVar4; } @Override public void c(SSLSocket sSLSocket, String str, List<Protocol> list) { if (str != null) { this.f153b.e(sSLSocket, Boolean.TRUE); this.f154c.e(sSLSocket, str); } f<Socket> fVar = this.f158g; if (fVar == null || !fVar.g(sSLSocket)) { return; } this.f158g.f(sSLSocket, g.b(list)); } @Override public void d(Socket socket, InetSocketAddress inetSocketAddress, int i10) throws IOException { try { socket.connect(inetSocketAddress, i10); } catch (SecurityException e10) { IOException iOException = new IOException("Exception in connect"); iOException.initCause(e10); throw iOException; } } @Override public String h(SSLSocket sSLSocket) { byte[] bArr; f<Socket> fVar = this.f157f; if (fVar == null || !fVar.g(sSLSocket) || (bArr = (byte[]) this.f157f.f(sSLSocket, new Object[0])) == null) { return null; } return new String(bArr, i.f170c); } @Override public void j(Socket socket) throws SocketException { Method method = this.f155d; if (method == null) { return; } try { method.invoke(null, socket); } catch (IllegalAccessException e10) { throw new RuntimeException(e10); } catch (InvocationTargetException e11) { throw new RuntimeException(e11.getCause()); } } @Override public void k(Socket socket) throws SocketException { Method method = this.f156e; if (method == null) { return; } try { method.invoke(null, socket); } catch (IllegalAccessException e10) { throw new RuntimeException(e10); } catch (InvocationTargetException e11) { throw new RuntimeException(e11.getCause()); } } } public static class b extends g { private final Method f159b; private final Method f160c; private final Method f161d; private final Class<?> f162e; private final Class<?> f163f; public b(Method method, Method method2, Method method3, Class<?> cls, Class<?> cls2) { this.f159b = method; this.f160c = method2; this.f161d = method3; this.f162e = cls; this.f163f = cls2; } @Override public void a(SSLSocket sSLSocket) { try { this.f161d.invoke(null, sSLSocket); } catch (IllegalAccessException | InvocationTargetException unused) { throw new AssertionError(); } } @Override public void c(SSLSocket sSLSocket, String str, List<Protocol> list) { ArrayList arrayList = new ArrayList(list.size()); int size = list.size(); for (int i10 = 0; i10 < size; i10++) { Protocol protocol = list.get(i10); if (protocol != Protocol.HTTP_1_0) { arrayList.add(protocol.toString()); } } try { this.f159b.invoke(null, sSLSocket, Proxy.newProxyInstance(g.class.getClassLoader(), new Class[]{this.f162e, this.f163f}, new c(arrayList))); } catch (IllegalAccessException | InvocationTargetException e10) { throw new AssertionError(e10); } } @Override public String h(SSLSocket sSLSocket) { try { c cVar = (c) Proxy.getInvocationHandler(this.f160c.invoke(null, sSLSocket)); if (!cVar.f165b && cVar.f166c == null) { ab.b.f146a.log(Level.INFO, "ALPN callback dropped: SPDY and HTTP/2 are disabled. Is alpn-boot on the boot class path?"); return null; } if (cVar.f165b) { return null; } return cVar.f166c; } catch (IllegalAccessException | InvocationTargetException unused) { throw new AssertionError(); } } } private static class c implements InvocationHandler { private final List<String> f164a; private boolean f165b; private String f166c; public c(List<String> list) { this.f164a = list; } @Override public Object invoke(Object obj, Method method, Object[] objArr) throws Throwable { Object obj2; String name = method.getName(); Class<?> returnType = method.getReturnType(); if (objArr == null) { objArr = i.f169b; } if (name.equals("supports") && Boolean.TYPE == returnType) { return Boolean.TRUE; } if (name.equals("unsupported") && Void.TYPE == returnType) { this.f165b = true; return null; } if (name.equals("protocols") && objArr.length == 0) { return this.f164a; } if ((name.equals("selectProtocol") || name.equals("select")) && String.class == returnType && objArr.length == 1) { Object obj3 = objArr[0]; if (obj3 instanceof List) { List list = (List) obj3; int size = list.size(); int i10 = 0; while (true) { if (i10 >= size) { obj2 = this.f164a.get(0); break; } if (this.f164a.contains(list.get(i10))) { obj2 = list.get(i10); break; } i10++; } String str = (String) obj2; this.f166c = str; return str; } } if ((!name.equals("protocolSelected") && !name.equals("selected")) || objArr.length != 1) { return method.invoke(this, objArr); } this.f166c = (String) objArr[0]; return null; } } static byte[] b(List<Protocol> list) { Buffer buffer = new Buffer(); int size = list.size(); for (int i10 = 0; i10 < size; i10++) { Protocol protocol = list.get(i10); if (protocol != Protocol.HTTP_1_0) { buffer.writeByte(protocol.toString().length()); buffer.writeUtf8(protocol.toString()); } } return buffer.readByteArray(); } private static g e() { Method method; f fVar; Method method2; try { try { Class.forName("com.android.org.conscrypt.OpenSSLSocketImpl"); } catch (ClassNotFoundException unused) { try { Class<?> cls = Class.forName("org.eclipse.jetty.alpn.ALPN"); Class<?> cls2 = Class.forName("org.eclipse.jetty.alpn.ALPN$Provider"); return new b(cls.getMethod("put", SSLSocket.class, cls2), cls.getMethod("get", SSLSocket.class), cls.getMethod("remove", SSLSocket.class), Class.forName("org.eclipse.jetty.alpn.ALPN$ClientProvider"), Class.forName("org.eclipse.jetty.alpn.ALPN$ServerProvider")); } catch (ClassNotFoundException | NoSuchMethodException unused2) { return new g(); } } } catch (ClassNotFoundException unused3) { Class.forName("org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl"); } f fVar2 = null; f fVar3 = new f(null, "setUseSessionTickets", Boolean.TYPE); f fVar4 = new f(null, "setHostname", String.class); try { Class<?> cls3 = Class.forName("android.net.TrafficStats"); method2 = cls3.getMethod("tagSocket", Socket.class); try { method = cls3.getMethod("untagSocket", Socket.class); try { Class.forName("android.net.Network"); fVar = new f(byte[].class, "getAlpnSelectedProtocol", new Class[0]); try { fVar2 = new f(null, "setAlpnProtocols", byte[].class); } catch (ClassNotFoundException | NoSuchMethodException unused4) { } } catch (ClassNotFoundException | NoSuchMethodException unused5) { fVar = null; } } catch (ClassNotFoundException | NoSuchMethodException unused6) { method = null; fVar = null; } } catch (ClassNotFoundException | NoSuchMethodException unused7) { method = null; fVar = null; method2 = null; } return new a(fVar3, fVar4, method2, method, fVar, fVar2); } public static g f() { return f152a; } public void a(SSLSocket sSLSocket) { } public void c(SSLSocket sSLSocket, String str, List<Protocol> list) { } public void d(Socket socket, InetSocketAddress inetSocketAddress, int i10) throws IOException { socket.connect(inetSocketAddress, i10); } public String g() { return "OkHttp"; } public String h(SSLSocket sSLSocket) { return null; } public void i(String str) { System.out.println(str); } public void j(Socket socket) throws SocketException { } public void k(Socket socket) throws SocketException { } }