package ඓ.ඓ.K.㿎;

import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.converter.scalars.ScalarsConverterFactory;
import ඓ.K.K.K.C1293;
import 㿎.C2625;
import 㿎.ሽ.ᨨ.C2558;

/* renamed from: ඓ.ඓ.K.㿎.K  reason: contains not printable characters */
/* compiled from: IndiaDKFactory */
public class C0701 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public static C0701 f3707 = new C0701();

    /* renamed from: ῲ  reason: contains not printable characters */
    public TrustManager[] f3708 = {new C0702(this)};

    /* renamed from: K  reason: contains not printable characters */
    public Map<String, Retrofit> f3709 = new HashMap();

    /* renamed from: ඓ.ඓ.K.㿎.K$K  reason: contains not printable characters */
    /* compiled from: IndiaDKFactory */
    public class C0702 implements X509TrustManager {
        public C0702(C0701 k) {
        }

        @Override // javax.net.ssl.X509TrustManager
        public void checkClientTrusted(X509Certificate[] x509CertificateArr, String str) throws CertificateException {
        }

        @Override // javax.net.ssl.X509TrustManager
        public void checkServerTrusted(X509Certificate[] x509CertificateArr, String str) throws CertificateException {
        }

        public X509Certificate[] getAcceptedIssuers() {
            return new X509Certificate[0];
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:13:0x0066  */
    /* JADX WARNING: Removed duplicated region for block: B:20:0x00cb  */
    /* renamed from: K  reason: contains not printable characters */
    public AbstractC0700 m2131() {
        SSLContext sSLContext;
        SSLSocketFactory socketFactory;
        Exception e;
        Retrofit retrofit = this.f3709.get("http://adminyna.easycasher.club/adminappapi/");
        if (retrofit == null) {
            try {
                sSLContext = SSLContext.getInstance("TLS");
                try {
                    sSLContext.init(null, this.f3708, new SecureRandom());
                } catch (Exception e2) {
                    e = e2;
                }
            } catch (Exception e3) {
                e = e3;
                sSLContext = null;
                e.printStackTrace();
                C2625.C2626 r3 = new C2625.C2626();
                r3.m6924(40000, TimeUnit.MILLISECONDS);
                r3.m6923(40000, TimeUnit.MILLISECONDS);
                r3.m6922(40000, TimeUnit.MILLISECONDS);
                C0706 r4 = new C0706();
                r4.f3715 = null;
                r3.m6925(r4);
                r3.m6925(new C0705(this));
                r3.m6925(new C0697(this));
                r3.f8919 = new C0699(this);
                socketFactory = sSLContext.getSocketFactory();
                if (socketFactory == null) {
                }
            }
            C2625.C2626 r32 = new C2625.C2626();
            r32.m6924(40000, TimeUnit.MILLISECONDS);
            r32.m6923(40000, TimeUnit.MILLISECONDS);
            r32.m6922(40000, TimeUnit.MILLISECONDS);
            C0706 r42 = new C0706();
            r42.f3715 = null;
            r32.m6925(r42);
            r32.m6925(new C0705(this));
            r32.m6925(new C0697(this));
            r32.f8919 = new C0699(this);
            socketFactory = sSLContext.getSocketFactory();
            if (socketFactory == null) {
                r32.f8928 = socketFactory;
                C2558 r2 = C2558.f8643;
                X509TrustManager r43 = r2.m6725(socketFactory);
                if (r43 != null) {
                    r32.f8903 = r2.m6730(r43);
                    retrofit = new Retrofit.Builder().baseUrl("http://adminyna.easycasher.club/adminappapi/").addConverterFactory(ScalarsConverterFactory.create()).addConverterFactory(GsonConverterFactory.create()).client(new C2625(r32)).build();
                    this.f3709.put("http://adminyna.easycasher.club/adminappapi/", retrofit);
                } else {
                    StringBuilder r22 = C1293.m3416("Unable to extract the trust manager on ");
                    r22.append(C2558.f8643);
                    r22.append(", sslSocketFactory is ");
                    r22.append(socketFactory.getClass());
                    throw new IllegalStateException(r22.toString());
                }
            } else {
                throw new NullPointerException("sslSocketFactory == null");
            }
        }
        return (AbstractC0700) retrofit.create(AbstractC0700.class);
    }
}
