package 㿎;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import javax.net.ssl.SSLSocket;
import okhttp3.TlsVersion;
import 㿎.ሽ.C2540;

/* renamed from: 㿎.ᕣ  reason: contains not printable characters */
/* compiled from: ConnectionSpec */
public final class C2630 {

    /* renamed from: ඓ  reason: contains not printable characters */
    public static final C2665[] f8936 = {C2665.f9068, C2665.f9078, C2665.f9072, C2665.f9065, C2665.f9066, C2665.f9073};

    /* renamed from: ⁱ  reason: contains not printable characters */
    public static final C2630 f8937;

    /* renamed from: 㴹  reason: contains not printable characters */
    public static final C2665[] f8938 = {C2665.f9068, C2665.f9078, C2665.f9072, C2665.f9065, C2665.f9066, C2665.f9073, C2665.f9069, C2665.f9074, C2665.f9071, C2665.f9077, C2665.f9067, C2665.f9075, C2665.f9076};

    /* renamed from: 㿎  reason: contains not printable characters */
    public static final C2630 f8939 = new C2630(new C2631(false));

    /* renamed from: ʬ  reason: contains not printable characters */
    public final String[] f8940;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final boolean f8941;

    /* renamed from: K  reason: contains not printable characters */
    public final boolean f8942;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final String[] f8943;

    static {
        C2631 k = new C2631(true);
        k.m6945(f8936);
        k.m6944(TlsVersion.TLS_1_2);
        k.m6942(true);
        new C2630(k);
        C2631 k2 = new C2631(true);
        k2.m6945(f8938);
        k2.m6944(TlsVersion.TLS_1_2, TlsVersion.TLS_1_1, TlsVersion.TLS_1_0);
        k2.m6942(true);
        f8937 = new C2630(k2);
        C2631 k3 = new C2631(f8937);
        k3.m6944(TlsVersion.TLS_1_0);
        k3.m6942(true);
        new C2630(k3);
    }

    public C2630(C2631 k) {
        this.f8942 = k.f8946;
        this.f8940 = k.f8945;
        this.f8943 = k.f8944;
        this.f8941 = k.f8947;
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof C2630)) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        C2630 r5 = (C2630) obj;
        boolean z = this.f8942;
        if (z != r5.f8942) {
            return false;
        }
        return !z || (Arrays.equals(this.f8940, r5.f8940) && Arrays.equals(this.f8943, r5.f8943) && this.f8941 == r5.f8941);
    }

    public int hashCode() {
        if (this.f8942) {
            return ((((527 + Arrays.hashCode(this.f8940)) * 31) + Arrays.hashCode(this.f8943)) * 31) + (!this.f8941 ? 1 : 0);
        }
        return 17;
    }

    public String toString() {
        String str;
        List list;
        if (!this.f8942) {
            return "ConnectionSpec()";
        }
        String[] strArr = this.f8940;
        List<TlsVersion> list2 = null;
        String str2 = "[all enabled]";
        if (strArr != null) {
            if (strArr != null) {
                ArrayList arrayList = new ArrayList(strArr.length);
                for (String str3 : strArr) {
                    arrayList.add(C2665.m6991(str3));
                }
                list = Collections.unmodifiableList(arrayList);
            } else {
                list = null;
            }
            str = list.toString();
        } else {
            str = str2;
        }
        String[] strArr2 = this.f8943;
        if (strArr2 != null) {
            if (strArr2 != null) {
                list2 = TlsVersion.forJavaNames(strArr2);
            }
            str2 = list2.toString();
        }
        return "ConnectionSpec(cipherSuites=" + str + ", tlsVersions=" + str2 + ", supportsTlsExtensions=" + this.f8941 + ")";
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m6939() {
        return this.f8941;
    }

    /* renamed from: 㿎.ᕣ$K  reason: contains not printable characters */
    /* compiled from: ConnectionSpec */
    public static final class C2631 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public String[] f8944;

        /* renamed from: ῲ  reason: contains not printable characters */
        public String[] f8945;

        /* renamed from: K  reason: contains not printable characters */
        public boolean f8946;

        /* renamed from: 㸾  reason: contains not printable characters */
        public boolean f8947;

        public C2631(boolean z) {
            this.f8946 = z;
        }

        /* renamed from: ῲ  reason: contains not printable characters */
        public C2631 m6941(String... strArr) {
            if (!this.f8946) {
                throw new IllegalStateException("no TLS versions for cleartext connections");
            } else if (strArr.length != 0) {
                this.f8944 = (String[]) strArr.clone();
                return this;
            } else {
                throw new IllegalArgumentException("At least one TLS version is required");
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public C2631 m6945(C2665... r4) {
            if (this.f8946) {
                String[] strArr = new String[r4.length];
                for (int i = 0; i < r4.length; i++) {
                    strArr[i] = r4[i].f9079;
                }
                m6943(strArr);
                return this;
            }
            throw new IllegalStateException("no cipher suites for cleartext connections");
        }

        public C2631(C2630 r2) {
            this.f8946 = r2.f8942;
            this.f8945 = r2.f8940;
            this.f8944 = r2.f8943;
            this.f8947 = r2.f8941;
        }

        /* renamed from: K  reason: contains not printable characters */
        public C2631 m6943(String... strArr) {
            if (!this.f8946) {
                throw new IllegalStateException("no cipher suites for cleartext connections");
            } else if (strArr.length != 0) {
                this.f8945 = (String[]) strArr.clone();
                return this;
            } else {
                throw new IllegalArgumentException("At least one cipher suite is required");
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public C2631 m6944(TlsVersion... tlsVersionArr) {
            if (this.f8946) {
                String[] strArr = new String[tlsVersionArr.length];
                for (int i = 0; i < tlsVersionArr.length; i++) {
                    strArr[i] = tlsVersionArr[i].javaName;
                }
                m6941(strArr);
                return this;
            }
            throw new IllegalStateException("no TLS versions for cleartext connections");
        }

        /* renamed from: K  reason: contains not printable characters */
        public C2631 m6942(boolean z) {
            if (this.f8946) {
                this.f8947 = z;
                return this;
            }
            throw new IllegalStateException("no TLS extensions for cleartext connections");
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m6940(SSLSocket sSLSocket) {
        if (!this.f8942) {
            return false;
        }
        String[] strArr = this.f8943;
        if (strArr != null && !C2540.m6633(C2540.f8571, strArr, sSLSocket.getEnabledProtocols())) {
            return false;
        }
        String[] strArr2 = this.f8940;
        if (strArr2 == null || C2540.m6633(C2665.f9070, strArr2, sSLSocket.getEnabledCipherSuites())) {
            return true;
        }
        return false;
    }
}
