导航菜单

页面标题

页面副标题

万能钥匙 v1.1.23 - f.java 源代码

正在查看: 万能钥匙 v1.1.23 应用的 f.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package xk0;

import al0.f;
import al0.m;
import com.zm.fda.OOZ20.OO22Z;
import gl0.d;
import hl0.d0;
import java.io.IOException;
import java.lang.ref.Reference;
import java.net.ConnectException;
import java.net.Proxy;
import java.net.Socket;
import java.net.SocketException;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import kotlin.Metadata;
import kotlin.jvm.internal.n;
import kotlin.jvm.internal.p;
import mg0.q;
import sk0.a0;
import sk0.b0;
import sk0.c0;
import sk0.e0;
import sk0.g0;
import sk0.l;
import sk0.r;
import sk0.t;
import sk0.v;

@Metadata(d1 = {"\u0000î\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010 \n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0013\n\u0002\u0010!\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\t\n\u0002\b\b\u0018\u0000 <2\u00020\u00012\u00020\u0002:\u0001[B\u0017\u0012\u0006\u0010\u0004\u001a\u00020\u0003\u0012\u0006\u0010\u0006\u001a\u00020\u0005¢\u0006\u0004\b\u0007\u0010\bJ7\u0010\u0012\u001a\u00020\u00112\u0006\u0010\n\u001a\u00020\t2\u0006\u0010\u000b\u001a\u00020\t2\u0006\u0010\f\u001a\u00020\t2\u0006\u0010\u000e\u001a\u00020\r2\u0006\u0010\u0010\u001a\u00020\u000fH\u0002¢\u0006\u0004\b\u0012\u0010\u0013J/\u0010\u0014\u001a\u00020\u00112\u0006\u0010\n\u001a\u00020\t2\u0006\u0010\u000b\u001a\u00020\t2\u0006\u0010\u000e\u001a\u00020\r2\u0006\u0010\u0010\u001a\u00020\u000fH\u0002¢\u0006\u0004\b\u0014\u0010\u0015J/\u0010\u0019\u001a\u00020\u00112\u0006\u0010\u0017\u001a\u00020\u00162\u0006\u0010\u0018\u001a\u00020\t2\u0006\u0010\u000e\u001a\u00020\r2\u0006\u0010\u0010\u001a\u00020\u000fH\u0002¢\u0006\u0004\b\u0019\u0010\u001aJ\u0017\u0010\u001b\u001a\u00020\u00112\u0006\u0010\u0018\u001a\u00020\tH\u0002¢\u0006\u0004\b\u001b\u0010\u001cJ\u0017\u0010\u001d\u001a\u00020\u00112\u0006\u0010\u0017\u001a\u00020\u0016H\u0002¢\u0006\u0004\b\u001d\u0010\u001eJ1\u0010#\u001a\u0004\u0018\u00010\u001f2\u0006\u0010\u000b\u001a\u00020\t2\u0006\u0010\f\u001a\u00020\t2\u0006\u0010 \u001a\u00020\u001f2\u0006\u0010\"\u001a\u00020!H\u0002¢\u0006\u0004\b#\u0010$J\u000f\u0010%\u001a\u00020\u001fH\u0002¢\u0006\u0004\b%\u0010&J\u001d\u0010*\u001a\u00020)2\f\u0010(\u001a\b\u0012\u0004\u0012\u00020\u00050'H\u0002¢\u0006\u0004\b*\u0010+J\u0017\u0010,\u001a\u00020)2\u0006\u0010\"\u001a\u00020!H\u0002¢\u0006\u0004\b,\u0010-J\u001f\u00100\u001a\u00020)2\u0006\u0010\"\u001a\u00020!2\u0006\u0010/\u001a\u00020.H\u0002¢\u0006\u0004\b0\u00101J\u000f\u00102\u001a\u00020\u0011H\u0000¢\u0006\u0004\b2\u00103J\u000f\u00104\u001a\u00020\u0011H\u0000¢\u0006\u0004\b4\u00103J\u000f\u00105\u001a\u00020\u0011H\u0000¢\u0006\u0004\b5\u00103JE\u00107\u001a\u00020\u00112\u0006\u0010\n\u001a\u00020\t2\u0006\u0010\u000b\u001a\u00020\t2\u0006\u0010\f\u001a\u00020\t2\u0006\u0010\u0018\u001a\u00020\t2\u0006\u00106\u001a\u00020)2\u0006\u0010\u000e\u001a\u00020\r2\u0006\u0010\u0010\u001a\u00020\u000f¢\u0006\u0004\b7\u00108J'\u0010<\u001a\u00020)2\u0006\u0010:\u001a\u0002092\u000e\u0010;\u001a\n\u0012\u0004\u0012\u00020\u0005\u0018\u00010'H\u0000¢\u0006\u0004\b<\u0010=J\u001f\u0010C\u001a\u00020B2\u0006\u0010?\u001a\u00020>2\u0006\u0010A\u001a\u00020@H\u0000¢\u0006\u0004\bC\u0010DJ\u0017\u0010H\u001a\u00020G2\u0006\u0010F\u001a\u00020EH\u0000¢\u0006\u0004\bH\u0010IJ\u000f\u0010J\u001a\u00020\u0005H\u0016¢\u0006\u0004\bJ\u0010KJ\r\u0010L\u001a\u00020\u0011¢\u0006\u0004\bL\u00103J\u000f\u0010N\u001a\u00020MH\u0016¢\u0006\u0004\bN\u0010OJ\u0015\u0010Q\u001a\u00020)2\u0006\u0010P\u001a\u00020)¢\u0006\u0004\bQ\u0010RJ\u0017\u0010U\u001a\u00020\u00112\u0006\u0010T\u001a\u00020SH\u0016¢\u0006\u0004\bU\u0010VJ\u001f\u0010[\u001a\u00020\u00112\u0006\u0010X\u001a\u00020W2\u0006\u0010Z\u001a\u00020YH\u0016¢\u0006\u0004\b[\u0010\\J\u0011\u0010]\u001a\u0004\u0018\u00010.H\u0016¢\u0006\u0004\b]\u0010^J'\u0010b\u001a\u00020\u00112\u0006\u0010?\u001a\u00020>2\u0006\u0010_\u001a\u00020\u00052\u0006\u0010a\u001a\u00020`H\u0000¢\u0006\u0004\bb\u0010cJ!\u0010e\u001a\u00020\u00112\u0006\u0010\u000e\u001a\u00020d2\b\u00100\u001a\u0004\u0018\u00010`H\u0000¢\u0006\u0004\be\u0010fJ\u000f\u0010h\u001a\u00020gH\u0016¢\u0006\u0004\bh\u0010iR\u0017\u0010\u0004\u001a\u00020\u00038\u0006¢\u0006\f\n\u0004\bj\u0010k\u001a\u0004\bl\u0010mR\u0014\u0010\u0006\u001a\u00020\u00058\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bL\u0010nR\u0018\u0010p\u001a\u0004\u0018\u00010M8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b0\u0010oR\u0018\u0010q\u001a\u0004\u0018\u00010M8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b7\u0010oR\u0018\u0010/\u001a\u0004\u0018\u00010.8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bb\u0010rR\u0018\u0010u\u001a\u0004\u0018\u00010s8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u0014\u0010tR\u0018\u0010w\u001a\u0004\u0018\u00010W8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u001d\u0010vR\u0018\u0010z\u001a\u0004\u0018\u00010x8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u0012\u0010yR\u0018\u0010}\u001a\u0004\u0018\u00010{8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b#\u0010|R&\u0010\u0083\u0001\u001a\u00020)8\u0006@\u0006X\u0086\u000e¢\u0006\u0015\n\u0004\b%\u0010~\u001a\u0005\b\u007f\u0010\u0080\u0001\"\u0006\b\u0081\u0001\u0010\u0082\u0001R\u0017\u0010\u0084\u0001\u001a\u00020)8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u0019\u0010~R(\u0010\u008a\u0001\u001a\u00020\t8\u0000@\u0000X\u0080\u000e¢\u0006\u0017\n\u0006\b\u0085\u0001\u0010\u0086\u0001\u001a\u0006\b\u0087\u0001\u0010\u0088\u0001\"\u0005\b\u0089\u0001\u0010\u001cR\u0019\u0010\u008c\u0001\u001a\u00020\t8\u0002@\u0002X\u0082\u000e¢\u0006\b\n\u0006\b\u008b\u0001\u0010\u0086\u0001R\u0018\u0010\u008d\u0001\u001a\u00020\t8\u0002@\u0002X\u0082\u000e¢\u0006\u0007\n\u0005\b\u007f\u0010\u0086\u0001R\u0019\u0010\u008e\u0001\u001a\u00020\t8\u0002@\u0002X\u0082\u000e¢\u0006\b\n\u0006\b\u0087\u0001\u0010\u0086\u0001R)\u0010\u0093\u0001\u001a\u0010\u0012\u000b\u0012\t\u0012\u0004\u0012\u00020d0\u0090\u00010\u008f\u00018\u0006¢\u0006\u000f\n\u0005\b]\u0010\u0091\u0001\u001a\u0006\b\u0085\u0001\u0010\u0092\u0001R)\u0010\u0099\u0001\u001a\u00030\u0094\u00018\u0000@\u0000X\u0080\u000e¢\u0006\u0017\n\u0005\b5\u0010\u0095\u0001\u001a\u0006\b\u008b\u0001\u0010\u0096\u0001\"\u0006\b\u0097\u0001\u0010\u0098\u0001R\u0017\u0010\u009b\u0001\u001a\u00020)8@X\u0080\u0004¢\u0006\b\u001a\u0006\b\u009a\u0001\u0010\u0080\u0001¨\u0006\u009c\u0001"}, d2 = {"Lxk0/f;", "Lal0/f$c;", "Lsk0/j;", "Lxk0/g;", "connectionPool", "Lsk0/g0;", "route", "<init>", "(Lxk0/g;Lsk0/g0;)V", "", "connectTimeout", "readTimeout", "writeTimeout", "Lsk0/e;", "call", "Lsk0/r;", "eventListener", "Llg0/e0;", "j", "(IIILsk0/e;Lsk0/r;)V", "h", "(IILsk0/e;Lsk0/r;)V", "Lxk0/b;", "connectionSpecSelector", "pingIntervalMillis", "m", "(Lxk0/b;ILsk0/e;Lsk0/r;)V", "F", "(I)V", "i", "(Lxk0/b;)V", "Lsk0/c0;", "tunnelRequest", "Lsk0/v;", "url", "k", "(IILsk0/c0;Lsk0/v;)Lsk0/c0;", "l", "()Lsk0/c0;", "", "candidates", "", "B", "(Ljava/util/List;)Z", "G", "(Lsk0/v;)Z", "Lsk0/t;", "handshake", "e", "(Lsk0/v;Lsk0/t;)Z", "z", "()V", "y", "s", "connectionRetryEnabled", "f", "(IIIIZLsk0/e;Lsk0/r;)V", "Lsk0/a;", "address", "routes", "t", "(Lsk0/a;Ljava/util/List;)Z", "Lsk0/a0;", "client", "Lyk0/g;", "chain", "Lyk0/d;", "w", "(Lsk0/a0;Lyk0/g;)Lyk0/d;", "Lxk0/c;", "exchange", "Lgl0/d$d;", "x", "(Lxk0/c;)Lgl0/d$d;", "A", "()Lsk0/g0;", "d", "Ljava/net/Socket;", "E", "()Ljava/net/Socket;", "doExtensiveChecks", "u", "(Z)Z", "Lal0/i;", "stream", "b", "(Lal0/i;)V", "Lal0/f;", "connection", "Lal0/m;", "settings", "a", "(Lal0/f;Lal0/m;)V", "r", "()Lsk0/t;", "failedRoute", "Ljava/io/IOException;", "failure", "g", "(Lsk0/a0;Lsk0/g0;Ljava/io/IOException;)V", "Lxk0/e;", "H", "(Lxk0/e;Ljava/io/IOException;)V", "", "toString", "()Ljava/lang/String;", "c", "Lxk0/g;", "getConnectionPool", "()Lxk0/g;", "Lsk0/g0;", "Ljava/net/Socket;", "rawSocket", "socket", "Lsk0/t;", "Lsk0/b0;", "Lsk0/b0;", "protocol", "Lal0/f;", "http2Connection", "Lhl0/g;", "Lhl0/g;", "source", "Lhl0/f;", "Lhl0/f;", "sink", "Z", OO22Z.j, "()Z", "D", "(Z)V", "noNewExchanges", "noCoalescedConnections", "n", "I", "q", "()I", "setRouteFailureCount$okhttp", "routeFailureCount", "o", "successCount", "refusedStreamCount", "allocationLimit", "", "Ljava/lang/ref/Reference;", "Ljava/util/List;", "()Ljava/util/List;", "calls", "", "J", "()J", "C", "(J)V", "idleAtNs", OO22Z.h, "isMultiplexed", "okhttp"}, k = 1, mv = {1, 8, 0}, xi = 48)
public final class f extends f.c implements sk0.j {

    public final g connectionPool;

    public final g0 route;

    public Socket rawSocket;

    public Socket socket;

    public t handshake;

    public b0 protocol;

    public al0.f http2Connection;

    public hl0.g source;

    public hl0.f sink;

    public boolean noNewExchanges;

    public boolean noCoalescedConnections;

    public int routeFailureCount;

    public int successCount;

    public int refusedStreamCount;

    public int allocationLimit;

    public final List<Reference<xk0.e>> calls;

    public long idleAtNs;

    @Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
    public final class b {
        public static final int[] a;

        static {
            int[] iArr = new int[Proxy.Type.values().length];
            try {
                iArr[Proxy.Type.DIRECT.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[Proxy.Type.HTTP.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            a = iArr;
        }
    }

    @Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001H\n¢\u0006\u0002\b\u0003"}, d2 = {"<anonymous>", "", "Ljava/security/cert/Certificate;", "invoke"}, k = 3, mv = {1, 8, 0}, xi = 48)
    public static final class c extends p implements ah0.a<List<? extends Certificate>> {
        public final sk0.g s;
        public final t t;
        public final sk0.a u;

        public c(sk0.g gVar, t tVar, sk0.a aVar) {
            super(0);
            this.s = gVar;
            this.t = tVar;
            this.u = aVar;
        }

        public final List<Certificate> invoke() {
            fl0.c certificateChainCleaner = this.s.getCertificateChainCleaner();
            n.f(certificateChainCleaner);
            return certificateChainCleaner.a(this.t.d(), this.u.getUrl().getHost());
        }
    }

    @Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001H\n¢\u0006\u0002\b\u0003"}, d2 = {"<anonymous>", "", "Ljava/security/cert/X509Certificate;", "invoke"}, k = 3, mv = {1, 8, 0}, xi = 48)
    public static final class d extends p implements ah0.a<List<? extends X509Certificate>> {
        public d() {
            super(0);
        }

        public final List<X509Certificate> invoke() {
            t tVar = f.this.handshake;
            n.f(tVar);
            List<Certificate> d = tVar.d();
            ArrayList arrayList = new ArrayList(q.u(d, 10));
            for (Certificate certificate : d) {
                n.g(certificate, "null cannot be cast to non-null type java.security.cert.X509Certificate");
                arrayList.add((X509Certificate) certificate);
            }
            return arrayList;
        }
    }

    @Metadata(d1 = {"\u0000\u0011\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u000f\u0010\u0003\u001a\u00020\u0002H\u0016¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"xk0/f$e", "Lgl0/d$d;", "Llg0/e0;", "close", "()V", "okhttp"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class e extends d.AbstractC0097d {
        public final xk0.c d;

        public e(hl0.g gVar, hl0.f fVar, xk0.c cVar) {
            super(true, gVar, fVar);
            this.d = cVar;
        }

        @Override
        public void close() {
            this.d.a(-1L, true, true, null);
        }
    }

    public f(g connectionPool, g0 route) {
        n.i(connectionPool, "connectionPool");
        n.i(route, "route");
        this.connectionPool = connectionPool;
        this.route = route;
        this.allocationLimit = 1;
        this.calls = new ArrayList();
        this.idleAtNs = Long.MAX_VALUE;
    }

    public g0 getRoute() {
        return this.route;
    }

    public final boolean B(List<g0> candidates) {
        List<g0> list = candidates;
        if ((list instanceof Collection) && list.isEmpty()) {
            return false;
        }
        for (g0 g0Var : list) {
            Proxy.Type type = g0Var.getProxy().type();
            Proxy.Type type2 = Proxy.Type.DIRECT;
            if (type == type2 && this.route.getProxy().type() == type2 && n.d(this.route.getSocketAddress(), g0Var.getSocketAddress())) {
                return true;
            }
        }
        return false;
    }

    public final void C(long j) {
        this.idleAtNs = j;
    }

    public final void D(boolean z) {
        this.noNewExchanges = z;
    }

    public Socket E() {
        Socket socket = this.socket;
        n.f(socket);
        return socket;
    }

    public final void F(int pingIntervalMillis) throws IOException {
        Socket socket = this.socket;
        n.f(socket);
        hl0.g gVar = this.source;
        n.f(gVar);
        hl0.f fVar = this.sink;
        n.f(fVar);
        socket.setSoTimeout(0);
        al0.f a = new f.a(true, wk0.e.i).q(socket, this.route.getAddress().getUrl().getHost(), gVar, fVar).k(this).l(pingIntervalMillis).a();
        this.http2Connection = a;
        this.allocationLimit = al0.f.C.a().d();
        al0.f.t1(a, false, (wk0.e) null, 3, (Object) null);
    }

    public final boolean G(v url) {
        t tVar;
        if (tk0.e.h && !Thread.holdsLock(this)) {
            throw new AssertionError("Thread " + Thread.currentThread().getName() + " MUST hold lock on " + this);
        }
        v url2 = this.route.getAddress().getUrl();
        if (url.getPort() != url2.getPort()) {
            return false;
        }
        if (n.d(url.getHost(), url2.getHost())) {
            return true;
        }
        if (!this.noCoalescedConnections && (tVar = this.handshake) != null) {
            n.f(tVar);
            if (e(url, tVar)) {
                return true;
            }
        }
        return false;
    }

    public final synchronized void H(xk0.e call, IOException e2) {
        try {
            n.i(call, "call");
            if (e2 instanceof al0.n) {
                if (((al0.n) e2).a == al0.b.j) {
                    int i = this.refusedStreamCount + 1;
                    this.refusedStreamCount = i;
                    if (i > 1) {
                        this.noNewExchanges = true;
                        this.routeFailureCount++;
                    }
                } else if (((al0.n) e2).a != al0.b.k || !call.getCanceled()) {
                    this.noNewExchanges = true;
                    this.routeFailureCount++;
                }
            } else if (!v() || (e2 instanceof al0.a)) {
                this.noNewExchanges = true;
                if (this.successCount == 0) {
                    if (e2 != null) {
                        g(call.getClient(), this.route, e2);
                    }
                    this.routeFailureCount++;
                }
            }
        } catch (Throwable th) {
            throw th;
        }
    }

    public synchronized void a(al0.f connection, m settings) {
        n.i(connection, "connection");
        n.i(settings, "settings");
        this.allocationLimit = settings.d();
    }

    public void b(al0.i stream) throws IOException {
        n.i(stream, "stream");
        stream.d(al0.b.j, (IOException) null);
    }

    public final void d() {
        Socket socket = this.rawSocket;
        if (socket != null) {
            tk0.e.n(socket);
        }
    }

    public final boolean e(v url, t handshake) {
        List<Certificate> d2 = handshake.d();
        if (!d2.isEmpty()) {
            fl0.d dVar = fl0.d.a;
            String host = url.getHost();
            Certificate certificate = d2.get(0);
            n.g(certificate, "null cannot be cast to non-null type java.security.cert.X509Certificate");
            if (dVar.e(host, (X509Certificate) certificate)) {
                return true;
            }
        }
        return false;
    }

    public final void f(int r13, int r14, int r15, int r16, boolean r17, sk0.e r18, sk0.r r19) {
        throw new UnsupportedOperationException("Method not decompiled: xk0.f.f(int, int, int, int, boolean, sk0.e, sk0.r):void");
    }

    public final void g(a0 client, g0 failedRoute, IOException failure) {
        n.i(client, "client");
        n.i(failedRoute, "failedRoute");
        n.i(failure, "failure");
        if (failedRoute.getProxy().type() != Proxy.Type.DIRECT) {
            sk0.a address = failedRoute.getAddress();
            address.getProxySelector().connectFailed(address.getUrl().t(), failedRoute.getProxy().address(), failure);
        }
        client.getRouteDatabase().b(failedRoute);
    }

    public final void h(int connectTimeout, int readTimeout, sk0.e call, r eventListener) throws IOException {
        Socket createSocket;
        Proxy proxy = this.route.getProxy();
        sk0.a address = this.route.getAddress();
        Proxy.Type type = proxy.type();
        int i = type == null ? -1 : b.a[type.ordinal()];
        if (i == 1 || i == 2) {
            createSocket = address.getSocketFactory().createSocket();
            n.f(createSocket);
        } else {
            createSocket = new Socket(proxy);
        }
        this.rawSocket = createSocket;
        eventListener.j(call, this.route.getSocketAddress(), proxy);
        createSocket.setSoTimeout(readTimeout);
        try {
            cl0.h.INSTANCE.g().f(createSocket, this.route.getSocketAddress(), connectTimeout);
            try {
                this.source = hl0.p.d(hl0.p.l(createSocket));
                this.sink = hl0.p.c(hl0.p.h(createSocket));
            } catch (NullPointerException e2) {
                if (n.d(e2.getMessage(), "throw with null exception")) {
                    throw new IOException(e2);
                }
            }
        } catch (ConnectException e3) {
            ConnectException connectException = new ConnectException("Failed to connect to " + this.route.getSocketAddress());
            connectException.initCause(e3);
            throw connectException;
        }
    }

    public final void i(xk0.b connectionSpecSelector) throws IOException {
        SSLSocket sSLSocket;
        sk0.a address = this.route.getAddress();
        SSLSocketFactory sslSocketFactory = address.getSslSocketFactory();
        SSLSocket sSLSocket2 = null;
        try {
            n.f(sslSocketFactory);
            Socket createSocket = sslSocketFactory.createSocket(this.rawSocket, address.getUrl().getHost(), address.getUrl().getPort(), true);
            n.g(createSocket, "null cannot be cast to non-null type javax.net.ssl.SSLSocket");
            sSLSocket = (SSLSocket) createSocket;
        } catch (Throwable th) {
            th = th;
        }
        try {
            l a = connectionSpecSelector.a(sSLSocket);
            if (a.getSupportsTlsExtensions()) {
                cl0.h.INSTANCE.g().e(sSLSocket, address.getUrl().getHost(), address.f());
            }
            sSLSocket.startHandshake();
            SSLSession sslSocketSession = sSLSocket.getSession();
            t.Companion companion = t.INSTANCE;
            n.h(sslSocketSession, "sslSocketSession");
            t a2 = companion.a(sslSocketSession);
            HostnameVerifier hostnameVerifier = address.getHostnameVerifier();
            n.f(hostnameVerifier);
            if (hostnameVerifier.verify(address.getUrl().getHost(), sslSocketSession)) {
                sk0.g certificatePinner = address.getCertificatePinner();
                n.f(certificatePinner);
                this.handshake = new t(a2.getTlsVersion(), a2.getCipherSuite(), a2.c(), new c(certificatePinner, a2, address));
                certificatePinner.b(address.getUrl().getHost(), new d());
                String h = a.getSupportsTlsExtensions() ? cl0.h.INSTANCE.g().h(sSLSocket) : null;
                this.socket = sSLSocket;
                this.source = hl0.p.d(hl0.p.l(sSLSocket));
                this.sink = hl0.p.c(hl0.p.h(sSLSocket));
                this.protocol = h != null ? b0.INSTANCE.a(h) : b0.HTTP_1_1;
                cl0.h.INSTANCE.g().b(sSLSocket);
                return;
            }
            List<Certificate> d2 = a2.d();
            if (d2.isEmpty()) {
                throw new SSLPeerUnverifiedException("Hostname " + address.getUrl().getHost() + " not verified (no certificates)");
            }
            Certificate certificate = d2.get(0);
            n.g(certificate, "null cannot be cast to non-null type java.security.cert.X509Certificate");
            X509Certificate x509Certificate = (X509Certificate) certificate;
            throw new SSLPeerUnverifiedException(tj0.m.h("\n              |Hostname " + address.getUrl().getHost() + " not verified:\n              |    certificate: " + sk0.g.INSTANCE.a(x509Certificate) + "\n              |    DN: " + x509Certificate.getSubjectDN().getName() + "\n              |    subjectAltNames: " + fl0.d.a.a(x509Certificate) + "\n              ", null, 1, null));
        } catch (Throwable th2) {
            th = th2;
            sSLSocket2 = sSLSocket;
            if (sSLSocket2 != null) {
                cl0.h.INSTANCE.g().b(sSLSocket2);
            }
            if (sSLSocket2 != null) {
                tk0.e.n(sSLSocket2);
            }
            throw th;
        }
    }

    public final void j(int connectTimeout, int readTimeout, int writeTimeout, sk0.e call, r eventListener) throws IOException {
        c0 l = l();
        v url = l.getUrl();
        for (int i = 0; i < 21; i++) {
            h(connectTimeout, readTimeout, call, eventListener);
            l = k(readTimeout, writeTimeout, l, url);
            if (l == null) {
                return;
            }
            Socket socket = this.rawSocket;
            if (socket != null) {
                tk0.e.n(socket);
            }
            this.rawSocket = null;
            this.sink = null;
            this.source = null;
            eventListener.h(call, this.route.getSocketAddress(), this.route.getProxy(), null);
        }
    }

    public final c0 k(int readTimeout, int writeTimeout, c0 tunnelRequest, v url) throws IOException {
        String str = "CONNECT " + tk0.e.T(url, true) + " HTTP/1.1";
        while (true) {
            hl0.g gVar = this.source;
            n.f(gVar);
            hl0.f fVar = this.sink;
            n.f(fVar);
            zk0.b bVar = new zk0.b(null, this, gVar, fVar);
            TimeUnit timeUnit = TimeUnit.MILLISECONDS;
            gVar.A().g(readTimeout, timeUnit);
            fVar.A().g(writeTimeout, timeUnit);
            bVar.A(tunnelRequest.getHeaders(), str);
            bVar.a();
            e0.a e2 = bVar.e(false);
            n.f(e2);
            e0 c2 = e2.r(tunnelRequest).c();
            bVar.z(c2);
            int code = c2.getCode();
            if (code == 200) {
                if (gVar.getBufferField().R0() && fVar.getBufferField().R0()) {
                    return null;
                }
                throw new IOException("TLS tunnel buffered too many bytes!");
            }
            if (code != 407) {
                throw new IOException("Unexpected response code for CONNECT: " + c2.getCode());
            }
            c0 a = this.route.getAddress().getProxyAuthenticator().a(this.route, c2);
            if (a == null) {
                throw new IOException("Failed to authenticate with proxy");
            }
            if (tj0.t.v("close", e0.v(c2, "Connection", null, 2, null), true)) {
                return a;
            }
            tunnelRequest = a;
        }
    }

    public final c0 l() throws IOException {
        c0 b2 = new c0.a().m(this.route.getAddress().getUrl()).g("CONNECT", null).e("Host", tk0.e.T(this.route.getAddress().getUrl(), true)).e("Proxy-Connection", "Keep-Alive").e("User-Agent", "okhttp/4.12.0").b();
        c0 a = this.route.getAddress().getProxyAuthenticator().a(this.route, new e0.a().r(b2).p(b0.HTTP_1_1).g(407).m("Preemptive Authenticate").b(tk0.e.c).s(-1L).q(-1L).j("Proxy-Authenticate", "OkHttp-Preemptive").c());
        return a == null ? b2 : a;
    }

    public final void m(xk0.b connectionSpecSelector, int pingIntervalMillis, sk0.e call, r eventListener) throws IOException {
        if (this.route.getAddress().getSslSocketFactory() != null) {
            eventListener.C(call);
            i(connectionSpecSelector);
            eventListener.B(call, this.handshake);
            if (this.protocol == b0.HTTP_2) {
                F(pingIntervalMillis);
                return;
            }
            return;
        }
        List<b0> f = this.route.getAddress().f();
        b0 b0Var = b0.H2_PRIOR_KNOWLEDGE;
        if (!f.contains(b0Var)) {
            this.socket = this.rawSocket;
            this.protocol = b0.HTTP_1_1;
        } else {
            this.socket = this.rawSocket;
            this.protocol = b0Var;
            F(pingIntervalMillis);
        }
    }

    public final List<Reference<xk0.e>> n() {
        return this.calls;
    }

    public final long getIdleAtNs() {
        return this.idleAtNs;
    }

    public final boolean getNoNewExchanges() {
        return this.noNewExchanges;
    }

    public final int getRouteFailureCount() {
        return this.routeFailureCount;
    }

    public t getHandshake() {
        return this.handshake;
    }

    public final synchronized void s() {
        this.successCount++;
    }

    public final boolean t(sk0.a address, List<g0> routes) {
        n.i(address, "address");
        if (tk0.e.h && !Thread.holdsLock(this)) {
            throw new AssertionError("Thread " + Thread.currentThread().getName() + " MUST hold lock on " + this);
        }
        if (this.calls.size() >= this.allocationLimit || this.noNewExchanges || !this.route.getAddress().d(address)) {
            return false;
        }
        if (n.d(address.getUrl().getHost(), getRoute().getAddress().getUrl().getHost())) {
            return true;
        }
        if (this.http2Connection == null || routes == null || !B(routes) || address.getHostnameVerifier() != fl0.d.a || !G(address.getUrl())) {
            return false;
        }
        try {
            sk0.g certificatePinner = address.getCertificatePinner();
            n.f(certificatePinner);
            String host = address.getUrl().getHost();
            t handshake = getHandshake();
            n.f(handshake);
            certificatePinner.a(host, handshake.d());
            return true;
        } catch (SSLPeerUnverifiedException unused) {
            return false;
        }
    }

    public String toString() {
        Object obj;
        StringBuilder sb = new StringBuilder();
        sb.append("Connection{");
        sb.append(this.route.getAddress().getUrl().getHost());
        sb.append(':');
        sb.append(this.route.getAddress().getUrl().getPort());
        sb.append(", proxy=");
        sb.append(this.route.getProxy());
        sb.append(" hostAddress=");
        sb.append(this.route.getSocketAddress());
        sb.append(" cipherSuite=");
        t tVar = this.handshake;
        if (tVar == null || (obj = tVar.getCipherSuite()) == null) {
            obj = "none";
        }
        sb.append(obj);
        sb.append(" protocol=");
        sb.append(this.protocol);
        sb.append('}');
        return sb.toString();
    }

    public final boolean u(boolean doExtensiveChecks) {
        long j;
        if (tk0.e.h && Thread.holdsLock(this)) {
            throw new AssertionError("Thread " + Thread.currentThread().getName() + " MUST NOT hold lock on " + this);
        }
        long nanoTime = System.nanoTime();
        Socket socket = this.rawSocket;
        n.f(socket);
        Socket socket2 = this.socket;
        n.f(socket2);
        hl0.g gVar = this.source;
        n.f(gVar);
        if (socket.isClosed() || socket2.isClosed() || socket2.isInputShutdown() || socket2.isOutputShutdown()) {
            return false;
        }
        al0.f fVar = this.http2Connection;
        if (fVar != null) {
            return fVar.F0(nanoTime);
        }
        synchronized (this) {
            j = nanoTime - this.idleAtNs;
        }
        if (j < 10000000000L || !doExtensiveChecks) {
            return true;
        }
        return tk0.e.G(socket2, gVar);
    }

    public final boolean v() {
        return this.http2Connection != null;
    }

    public final yk0.d w(a0 client, yk0.g chain) throws SocketException {
        n.i(client, "client");
        n.i(chain, "chain");
        Socket socket = this.socket;
        n.f(socket);
        hl0.g gVar = this.source;
        n.f(gVar);
        hl0.f fVar = this.sink;
        n.f(fVar);
        al0.f fVar2 = this.http2Connection;
        if (fVar2 != null) {
            return new al0.g(client, this, chain, fVar2);
        }
        socket.setSoTimeout(chain.j());
        d0 A = gVar.A();
        long readTimeoutMillis = chain.getReadTimeoutMillis();
        TimeUnit timeUnit = TimeUnit.MILLISECONDS;
        A.g(readTimeoutMillis, timeUnit);
        fVar.A().g(chain.getWriteTimeoutMillis(), timeUnit);
        return new zk0.b(client, this, gVar, fVar);
    }

    public final d.AbstractC0097d x(xk0.c exchange) throws SocketException {
        n.i(exchange, "exchange");
        Socket socket = this.socket;
        n.f(socket);
        hl0.g gVar = this.source;
        n.f(gVar);
        hl0.f fVar = this.sink;
        n.f(fVar);
        socket.setSoTimeout(0);
        z();
        return new e(gVar, fVar, exchange);
    }

    public final synchronized void y() {
        this.noCoalescedConnections = true;
    }

    public final synchronized void z() {
        this.noNewExchanges = true;
    }
}