package 㿎;

import java.net.Proxy;
import java.net.ProxySelector;
import java.net.Socket;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.net.SocketFactory;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
import okhttp3.Protocol;
import ඓ.K.K.K.C1293;
import 㿎.AbstractC2533;
import 㿎.AbstractC2537;
import 㿎.C2630;
import 㿎.C2667;
import 㿎.C2671;
import 㿎.ሽ.AbstractC2570;
import 㿎.ሽ.C2540;
import 㿎.ሽ.ඓ.C2543;
import 㿎.ሽ.ඓ.C2548;
import 㿎.ሽ.ඓ.C2550;
import 㿎.ሽ.ᨨ.C2558;
import 㿎.ሽ.㳳.AbstractC2571;
import 㿎.ሽ.㳳.C2575;
import 㿎.ሽ.㸾.AbstractC2587;

/* renamed from: 㿎.ᑓ  reason: contains not printable characters */
/* compiled from: OkHttpClient */
public class C2625 implements Cloneable, AbstractC2537.AbstractC2538, AbstractC2641 {

    /* renamed from: ᝁ  reason: contains not printable characters */
    public static final List<C2630> f8873 = C2540.m6647(C2630.f8937, C2630.f8939);

    /* renamed from: 䃖  reason: contains not printable characters */
    public static final List<Protocol> f8874 = C2540.m6647(Protocol.HTTP_2, Protocol.HTTP_1_1);

    /* renamed from: ʬ  reason: contains not printable characters */
    public final Proxy f8875;

    /* renamed from: Ԕ  reason: contains not printable characters */
    public final SSLSocketFactory f8876;

    /* renamed from: Ԛ  reason: contains not printable characters */
    public final AbstractC2647 f8877;

    /* renamed from: ؿ  reason: contains not printable characters */
    public final HostnameVerifier f8878;

    /* renamed from: ݜ  reason: contains not printable characters */
    public final AbstractC2636 f8879;

    /* renamed from: ඓ  reason: contains not printable characters */
    public final List<C2630> f8880;

    /* renamed from: ᑓ  reason: contains not printable characters */
    public final int f8881;

    /* renamed from: ᓆ  reason: contains not printable characters */
    public final boolean f8882;

    /* renamed from: ᓣ  reason: contains not printable characters */
    public final C2638 f8883;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public final C2529 f8884;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public final ProxySelector f8885;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final C2530 f8886;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public final List<AbstractC2661> f8887;

    /* renamed from: ゎ  reason: contains not printable characters */
    public final int f8888;

    /* renamed from: ト  reason: contains not printable characters */
    public final int f8889;

    /* renamed from: 㑃  reason: contains not printable characters */
    public final AbstractC2587 f8890;

    /* renamed from: 㗗  reason: contains not printable characters */
    public final AbstractC2571 f8891;

    /* renamed from: 㗽  reason: contains not printable characters */
    public final AbstractC2636 f8892;

    /* renamed from: 㮔  reason: contains not printable characters */
    public final int f8893;

    /* renamed from: 㳳  reason: contains not printable characters */
    public final AbstractC2669 f8894;

    /* renamed from: 㴪  reason: contains not printable characters */
    public final boolean f8895;

    /* renamed from: 㴹  reason: contains not printable characters */
    public final List<AbstractC2661> f8896;

    /* renamed from: 㶋  reason: contains not printable characters */
    public final boolean f8897;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final List<Protocol> f8898;

    /* renamed from: 㿎  reason: contains not printable characters */
    public final AbstractC2533.AbstractC2534 f8899;

    /* renamed from: 䀟  reason: contains not printable characters */
    public final C2655 f8900;

    /* renamed from: 䁗  reason: contains not printable characters */
    public final SocketFactory f8901;

    /* renamed from: 㿎.ᑓ$ῲ  reason: contains not printable characters */
    /* compiled from: OkHttpClient */
    public static final class C2626 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public List<Protocol> f8902;

        /* renamed from: Ԕ  reason: contains not printable characters */
        public AbstractC2571 f8903;

        /* renamed from: Ԛ  reason: contains not printable characters */
        public boolean f8904;

        /* renamed from: ؿ  reason: contains not printable characters */
        public C2638 f8905;

        /* renamed from: ݜ  reason: contains not printable characters */
        public C2655 f8906;

        /* renamed from: ඓ  reason: contains not printable characters */
        public final List<AbstractC2661> f8907;

        /* renamed from: ᑓ  reason: contains not printable characters */
        public int f8908;

        /* renamed from: ᓆ  reason: contains not printable characters */
        public boolean f8909;

        /* renamed from: ᓣ  reason: contains not printable characters */
        public AbstractC2636 f8910;

        /* renamed from: ᕣ  reason: contains not printable characters */
        public AbstractC2587 f8911;

        /* renamed from: ᨨ  reason: contains not printable characters */
        public AbstractC2669 f8912;

        /* renamed from: ῲ  reason: contains not printable characters */
        public Proxy f8913;

        /* renamed from: ⁱ  reason: contains not printable characters */
        public AbstractC2533.AbstractC2534 f8914;

        /* renamed from: K  reason: contains not printable characters */
        public C2530 f8915;

        /* renamed from: ゎ  reason: contains not printable characters */
        public int f8916;

        /* renamed from: ト  reason: contains not printable characters */
        public int f8917;

        /* renamed from: 㑃  reason: contains not printable characters */
        public SocketFactory f8918;

        /* renamed from: 㗗  reason: contains not printable characters */
        public HostnameVerifier f8919;

        /* renamed from: 㗽  reason: contains not printable characters */
        public AbstractC2636 f8920;

        /* renamed from: 㳳  reason: contains not printable characters */
        public C2529 f8921;

        /* renamed from: 㴪  reason: contains not printable characters */
        public int f8922;

        /* renamed from: 㴹  reason: contains not printable characters */
        public final List<AbstractC2661> f8923;

        /* renamed from: 㶋  reason: contains not printable characters */
        public boolean f8924;

        /* renamed from: 㸾  reason: contains not printable characters */
        public List<C2630> f8925;

        /* renamed from: 㿎  reason: contains not printable characters */
        public ProxySelector f8926;

        /* renamed from: 䀟  reason: contains not printable characters */
        public AbstractC2647 f8927;

        /* renamed from: 䁗  reason: contains not printable characters */
        public SSLSocketFactory f8928;

        public C2626() {
            this.f8907 = new ArrayList();
            this.f8923 = new ArrayList();
            this.f8915 = new C2530();
            this.f8902 = C2625.f8874;
            this.f8925 = C2625.f8873;
            this.f8914 = new C2629(AbstractC2533.f8552);
            this.f8926 = ProxySelector.getDefault();
            this.f8912 = AbstractC2669.f9082;
            this.f8918 = SocketFactory.getDefault();
            this.f8919 = C2575.f8679;
            this.f8905 = C2638.f8956;
            AbstractC2636 r0 = AbstractC2636.f8955;
            this.f8910 = r0;
            this.f8920 = r0;
            this.f8906 = new C2655();
            this.f8927 = AbstractC2647.f9006;
            this.f8904 = true;
            this.f8924 = true;
            this.f8909 = true;
            this.f8922 = 10000;
            this.f8908 = 10000;
            this.f8916 = 10000;
            this.f8917 = 0;
        }

        /* renamed from: ʬ  reason: contains not printable characters */
        public C2626 m6922(long j, TimeUnit timeUnit) {
            this.f8916 = C2540.m6638("timeout", j, timeUnit);
            return this;
        }

        /* renamed from: ῲ  reason: contains not printable characters */
        public C2626 m6923(long j, TimeUnit timeUnit) {
            this.f8908 = C2540.m6638("timeout", j, timeUnit);
            return this;
        }

        /* renamed from: K  reason: contains not printable characters */
        public C2626 m6924(long j, TimeUnit timeUnit) {
            this.f8922 = C2540.m6638("timeout", j, timeUnit);
            return this;
        }

        /* renamed from: K  reason: contains not printable characters */
        public C2626 m6925(AbstractC2661 r2) {
            if (r2 != null) {
                this.f8907.add(r2);
                return this;
            }
            throw new IllegalArgumentException("interceptor == null");
        }

        public C2626(C2625 r3) {
            this.f8907 = new ArrayList();
            this.f8923 = new ArrayList();
            this.f8915 = r3.f8886;
            this.f8913 = r3.f8875;
            this.f8902 = r3.f8898;
            this.f8925 = r3.f8880;
            this.f8907.addAll(r3.f8896);
            this.f8923.addAll(r3.f8887);
            this.f8914 = r3.f8899;
            this.f8926 = r3.f8885;
            this.f8912 = r3.f8894;
            AbstractC2587 r0 = r3.f8890;
            C2529 r02 = r3.f8884;
            this.f8918 = r3.f8901;
            this.f8928 = r3.f8876;
            this.f8903 = r3.f8891;
            this.f8919 = r3.f8878;
            this.f8905 = r3.f8883;
            this.f8910 = r3.f8892;
            this.f8920 = r3.f8879;
            this.f8906 = r3.f8900;
            this.f8927 = r3.f8877;
            this.f8904 = r3.f8897;
            this.f8924 = r3.f8882;
            this.f8909 = r3.f8895;
            this.f8922 = r3.f8881;
            this.f8908 = r3.f8888;
            this.f8916 = r3.f8889;
            this.f8917 = r3.f8893;
        }
    }

    static {
        AbstractC2570.f8676 = new C2627();
    }

    public C2625() {
        this(new C2626());
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public C2626 m6918() {
        return new C2626(this);
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public void m6919() {
    }

    /* renamed from: K  reason: contains not printable characters */
    public AbstractC2537 m6920(C2644 r3) {
        C2642 r0 = new C2642(this, r3, false);
        r0.f8979 = ((C2629) this.f8899).f8935;
        return r0;
    }

    public C2625(C2626 r7) {
        boolean z;
        this.f8886 = r7.f8915;
        this.f8875 = r7.f8913;
        this.f8898 = r7.f8902;
        this.f8880 = r7.f8925;
        this.f8896 = C2540.m6646(r7.f8907);
        this.f8887 = C2540.m6646(r7.f8923);
        this.f8899 = r7.f8914;
        this.f8885 = r7.f8926;
        this.f8894 = r7.f8912;
        C2529 r1 = r7.f8921;
        AbstractC2587 r12 = r7.f8911;
        this.f8901 = r7.f8918;
        Iterator<C2630> it2 = this.f8880.iterator();
        loop0:
        while (true) {
            z = false;
            while (true) {
                if (!it2.hasNext()) {
                    break loop0;
                }
                C2630 next = it2.next();
                if (z || next.f8942) {
                    z = true;
                }
            }
        }
        if (r7.f8928 != null || !z) {
            this.f8876 = r7.f8928;
            this.f8891 = r7.f8903;
        } else {
            try {
                TrustManagerFactory instance = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
                instance.init((KeyStore) null);
                TrustManager[] trustManagers = instance.getTrustManagers();
                if (trustManagers.length != 1 || !(trustManagers[0] instanceof X509TrustManager)) {
                    throw new IllegalStateException("Unexpected default trust managers:" + Arrays.toString(trustManagers));
                }
                X509TrustManager x509TrustManager = (X509TrustManager) trustManagers[0];
                try {
                    SSLContext r3 = C2558.f8643.m6729();
                    r3.init(null, new TrustManager[]{x509TrustManager}, null);
                    this.f8876 = r3.getSocketFactory();
                    this.f8891 = C2558.f8643.m6730(x509TrustManager);
                } catch (GeneralSecurityException e) {
                    throw C2540.m6640("No System TLS", (Exception) e);
                }
            } catch (GeneralSecurityException e2) {
                throw C2540.m6640("No System TLS", (Exception) e2);
            }
        }
        SSLSocketFactory sSLSocketFactory = this.f8876;
        if (sSLSocketFactory != null) {
            C2558.f8643.m6736(sSLSocketFactory);
        }
        this.f8878 = r7.f8919;
        C2638 r0 = r7.f8905;
        AbstractC2571 r13 = this.f8891;
        this.f8883 = !C2540.m6654(r0.f8957, r13) ? new C2638(r0.f8958, r13) : r0;
        this.f8892 = r7.f8910;
        this.f8879 = r7.f8920;
        this.f8900 = r7.f8906;
        this.f8877 = r7.f8927;
        this.f8897 = r7.f8904;
        this.f8882 = r7.f8924;
        this.f8895 = r7.f8909;
        this.f8881 = r7.f8922;
        this.f8888 = r7.f8908;
        this.f8889 = r7.f8916;
        this.f8893 = r7.f8917;
        if (this.f8896.contains(null)) {
            StringBuilder r02 = C1293.m3416("Null interceptor: ");
            r02.append(this.f8896);
            throw new IllegalStateException(r02.toString());
        } else if (this.f8887.contains(null)) {
            StringBuilder r03 = C1293.m3416("Null network interceptor: ");
            r03.append(this.f8887);
            throw new IllegalStateException(r03.toString());
        }
    }

    /* renamed from: 㿎.ᑓ$K  reason: contains not printable characters */
    /* compiled from: OkHttpClient */
    public class C2627 extends AbstractC2570 {
        @Override // 㿎.ሽ.AbstractC2570
        /* renamed from: ῲ  reason: contains not printable characters */
        public void m6926(C2655 r3, C2543 r4) {
            if (!r3.f9026) {
                r3.f9026 = true;
                C2655.f9021.execute(r3.f9022);
            }
            r3.f9027.add(r4);
        }

        @Override // 㿎.ሽ.AbstractC2570
        /* renamed from: K  reason: contains not printable characters */
        public C2543 m6929(C2655 r3, C2640 k, C2548 r5, C2539 r6) {
            for (C2543 r0 : r3.f9027) {
                if (r0.m6668(k, r6)) {
                    r5.m6685(r0, true);
                    return r0;
                }
            }
            return null;
        }

        @Override // 㿎.ሽ.AbstractC2570
        /* renamed from: K  reason: contains not printable characters */
        public void m6932(C2667.C2668 k, String str) {
            k.m7001(str);
        }

        @Override // 㿎.ሽ.AbstractC2570
        /* renamed from: K  reason: contains not printable characters */
        public Socket m6928(C2655 r3, C2640 k, C2548 r5) {
            for (C2543 r0 : r3.f9027) {
                if (r0.m6668(k, null) && r0.m6666() && r0 != r5.m6676()) {
                    if (r5.f8609 == null && r5.f8617.f8580.size() == 1) {
                        Socket r1 = r5.m6679(true, false, false);
                        r5.f8617 = r0;
                        r0.f8580.add(r5.f8617.f8580.get(0));
                        return r1;
                    }
                    throw new IllegalStateException();
                }
            }
            return null;
        }

        @Override // 㿎.ሽ.AbstractC2570
        /* renamed from: K  reason: contains not printable characters */
        public boolean m6935(C2655 r1, C2543 r2) {
            return r1.m6981(r2);
        }

        @Override // 㿎.ሽ.AbstractC2570
        /* renamed from: K  reason: contains not printable characters */
        public void m6931(C2630 r7, SSLSocket sSLSocket, boolean z) {
            String[] strArr;
            String[] strArr2;
            if (r7.f8940 != null) {
                strArr = C2540.m6656(C2665.f9070, sSLSocket.getEnabledCipherSuites(), r7.f8940);
            } else {
                strArr = sSLSocket.getEnabledCipherSuites();
            }
            if (r7.f8943 != null) {
                strArr2 = C2540.m6656(C2540.f8571, sSLSocket.getEnabledProtocols(), r7.f8943);
            } else {
                strArr2 = sSLSocket.getEnabledProtocols();
            }
            String[] supportedCipherSuites = sSLSocket.getSupportedCipherSuites();
            int r3 = C2540.m6639(C2665.f9070, supportedCipherSuites, "TLS_FALLBACK_SCSV");
            if (z && r3 != -1) {
                String str = supportedCipherSuites[r3];
                String[] strArr3 = new String[(strArr.length + 1)];
                System.arraycopy(strArr, 0, strArr3, 0, strArr.length);
                strArr3[strArr3.length - 1] = str;
                strArr = strArr3;
            }
            C2630.C2631 k = new C2630.C2631(r7);
            k.m6943(strArr);
            k.m6941(strArr2);
            C2630 r72 = new C2630(k);
            String[] strArr4 = r72.f8943;
            if (strArr4 != null) {
                sSLSocket.setEnabledProtocols(strArr4);
            }
            String[] strArr5 = r72.f8940;
            if (strArr5 != null) {
                sSLSocket.setEnabledCipherSuites(strArr5);
            }
        }

        @Override // 㿎.ሽ.AbstractC2570
        /* renamed from: K  reason: contains not printable characters */
        public boolean m6934(C2640 k, C2640 k2) {
            return k.m6951(k2);
        }

        @Override // 㿎.ሽ.AbstractC2570
        /* renamed from: K  reason: contains not printable characters */
        public C2550 m6930(C2655 r1) {
            return r1.f9023;
        }

        @Override // 㿎.ሽ.AbstractC2570
        /* renamed from: K  reason: contains not printable characters */
        public int m6927(C2671.C2672 k) {
            return k.f9095;
        }

        @Override // 㿎.ሽ.AbstractC2570
        /* renamed from: K  reason: contains not printable characters */
        public void m6933(C2667.C2668 k, String str, String str2) {
            k.f9081.add(str);
            k.f9081.add(str2.trim());
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public AbstractC2669 m6921() {
        return this.f8894;
    }
}
