package 㿎.ሽ.ඓ;

import java.io.IOException;
import java.net.UnknownServiceException;
import java.util.Arrays;
import java.util.List;
import javax.net.ssl.SSLSocket;
import ඓ.K.K.K.C1293;
import 㿎.C2630;
import 㿎.ሽ.AbstractC2570;

/* renamed from: 㿎.ሽ.ඓ.ῲ  reason: contains not printable characters */
/* compiled from: ConnectionSpecSelector */
public final class C2546 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public boolean f8603;

    /* renamed from: ῲ  reason: contains not printable characters */
    public int f8604 = 0;

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

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

    public C2546(List<C2630> list) {
        this.f8605 = list;
    }

    /* renamed from: K  reason: contains not printable characters */
    public C2630 m6674(SSLSocket sSLSocket) throws IOException {
        boolean z;
        C2630 r3;
        int i = this.f8604;
        int size = this.f8605.size();
        while (true) {
            z = true;
            if (i >= size) {
                r3 = null;
                break;
            }
            r3 = this.f8605.get(i);
            if (r3.m6940(sSLSocket)) {
                this.f8604 = i + 1;
                break;
            }
            i++;
        }
        if (r3 != null) {
            int i2 = this.f8604;
            while (true) {
                if (i2 >= this.f8605.size()) {
                    z = false;
                    break;
                } else if (this.f8605.get(i2).m6940(sSLSocket)) {
                    break;
                } else {
                    i2++;
                }
            }
            this.f8603 = z;
            AbstractC2570.f8676.m6761(r3, sSLSocket, this.f8606);
            return r3;
        }
        StringBuilder r1 = C1293.m3416("Unable to find acceptable protocols. isFallback=");
        r1.append(this.f8606);
        r1.append(", modes=");
        r1.append(this.f8605);
        r1.append(", supported protocols=");
        r1.append(Arrays.toString(sSLSocket.getEnabledProtocols()));
        throw new UnknownServiceException(r1.toString());
    }
}
