package XnFJ5_9.Ft6VRog_36.KNBe_11;

import XnFJ5_9.WGk6X_27;
import XnFJ5_9.XuVgy_28;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;
/* compiled from: Platform.java */
/* loaded from: classes.dex */
public class X6FRs_4 {
    public static final X6FRs_4 KQgRr5e_0 = KQgRr5e_0();

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public static final Logger f1520KQgRr5e_0 = Logger.getLogger(WGk6X_27.class.getName());

    public static X6FRs_4 QxJ9d_1() {
        return KQgRr5e_0;
    }

    @Nullable
    public String KQgRr5e_0(SSLSocket sSLSocket) {
        return null;
    }

    public void KQgRr5e_0(Socket socket, InetSocketAddress inetSocketAddress, int i) throws IOException {
        socket.connect(inetSocketAddress, i);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public void m699KQgRr5e_0(SSLSocket sSLSocket) {
    }

    public void KQgRr5e_0(SSLSocket sSLSocket, @Nullable String str, List<XuVgy_28> list) {
    }

    public void KQgRr5e_0(SSLSocketFactory sSLSocketFactory) {
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public boolean m700KQgRr5e_0(String str) {
        return true;
    }

    public String toString() {
        return getClass().getSimpleName();
    }

    public void KQgRr5e_0(int i, String str, @Nullable Throwable th) {
        f1520KQgRr5e_0.log(i == 5 ? Level.WARNING : Level.INFO, str, th);
    }

    @Nullable
    public Object KQgRr5e_0(String str) {
        if (f1520KQgRr5e_0.isLoggable(Level.FINE)) {
            return new Throwable(str);
        }
        return null;
    }

    public void KQgRr5e_0(String str, Object obj) {
        if (obj == null) {
            str = str + " To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);";
        }
        KQgRr5e_0(5, str, (Throwable) obj);
    }

    public static List<String> KQgRr5e_0(List<XuVgy_28> list) {
        ArrayList arrayList = new ArrayList(list.size());
        int size = list.size();
        for (int i = 0; i < size; i++) {
            XuVgy_28 xuVgy_28 = list.get(i);
            if (xuVgy_28 != XuVgy_28.HTTP_1_0) {
                arrayList.add(xuVgy_28.toString());
            }
        }
        return arrayList;
    }

    public XnFJ5_9.Ft6VRog_36.WwEq_13.PGPF6hQ_2 KQgRr5e_0(X509TrustManager x509TrustManager) {
        return new XnFJ5_9.Ft6VRog_36.WwEq_13.KQgRr5e_0(m697KQgRr5e_0(x509TrustManager));
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public static boolean m695KQgRr5e_0() {
        if ("conscrypt".equals(XnFJ5_9.Ft6VRog_36.X6FRs_4.KQgRr5e_0("okhttp.platform", (String) null))) {
            return true;
        }
        return "Conscrypt".equals(Security.getProviders()[0].getName());
    }

    public static X6FRs_4 KQgRr5e_0() {
        QxJ9d_1 KQgRr5e_02;
        X6FRs_4 PGPF6hQ_2 = KQgRr5e_0.PGPF6hQ_2();
        if (PGPF6hQ_2 != null) {
            return PGPF6hQ_2;
        }
        if (!m695KQgRr5e_0() || (KQgRr5e_02 = QxJ9d_1.KQgRr5e_0()) == null) {
            Mqv2r_3 KQgRr5e_03 = Mqv2r_3.KQgRr5e_0();
            if (KQgRr5e_03 != null) {
                return KQgRr5e_03;
            }
            X6FRs_4 PGPF6hQ_22 = PGPF6hQ_2.PGPF6hQ_2();
            return PGPF6hQ_22 != null ? PGPF6hQ_22 : new X6FRs_4();
        }
        return KQgRr5e_02;
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public static byte[] m696KQgRr5e_0(List<XuVgy_28> list) {
        Nm6q_10.X6FRs_4 x6FRs_4 = new Nm6q_10.X6FRs_4();
        int size = list.size();
        for (int i = 0; i < size; i++) {
            XuVgy_28 xuVgy_28 = list.get(i);
            if (xuVgy_28 != XuVgy_28.HTTP_1_0) {
                x6FRs_4.KQgRr5e_0(xuVgy_28.toString().length());
                x6FRs_4.KQgRr5e_0(xuVgy_28.toString());
            }
        }
        return x6FRs_4.KQgRr5e_0();
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public SSLContext mo698KQgRr5e_0() {
        try {
            return SSLContext.getInstance("TLS");
        } catch (NoSuchAlgorithmException e) {
            throw new IllegalStateException("No TLS provider", e);
        }
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public XnFJ5_9.Ft6VRog_36.WwEq_13.X6FRs_4 m697KQgRr5e_0(X509TrustManager x509TrustManager) {
        return new XnFJ5_9.Ft6VRog_36.WwEq_13.QxJ9d_1(x509TrustManager.getAcceptedIssuers());
    }
}
