package o; import android.content.Context; import java.io.IOException; import java.net.InetAddress; import java.net.Socket; import java.net.UnknownHostException; import java.security.KeyManagementException; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.X509TrustManager; import org.apache.http.conn.ssl.BrowserCompatHostnameVerifier; import org.apache.http.conn.ssl.StrictHostnameVerifier; @Deprecated /* loaded from: classes2.dex */ public class WCI extends SSLSocketFactory { private static volatile WCI d; private SSLSocket a = null; private Context b; private SSLContext c; private String[] e; private X509TrustManager f; private String[] h; private String[] i; private String[] j; static { new BrowserCompatHostnameVerifier(); new StrictHostnameVerifier(); d = null; } @Override // javax.net.SocketFactory public Socket createSocket(String str, int i) throws IOException { Socket createSocket = this.c.getSocketFactory().createSocket(str, i); if (createSocket instanceof SSLSocket) { SSLSocket sSLSocket = (SSLSocket) createSocket; Tzr.a(sSLSocket); Tzr.e(sSLSocket); this.a = sSLSocket; this.e = (String[]) sSLSocket.getEnabledCipherSuites().clone(); } return createSocket; } @Deprecated public static WCI d(Context context) throws IOException, NoSuchAlgorithmException, CertificateException, KeyStoreException, IllegalAccessException, KeyManagementException, IllegalArgumentException { if (context != null && gHQ.e == null) { gHQ.e = context.getApplicationContext(); } if (d == null) { synchronized (WCI.class) { if (d == null) { d = new WCI(context); } } } if (d.b == null && context != null) { d.b = context.getApplicationContext(); } return d; } @Override // javax.net.SocketFactory public Socket createSocket(InetAddress inetAddress, int i) throws IOException { return createSocket(inetAddress.getHostAddress(), i); } @Override // javax.net.SocketFactory public Socket createSocket(String str, int i, InetAddress inetAddress, int i2) throws IOException, UnknownHostException { return createSocket(str, i); } @Override // javax.net.SocketFactory public Socket createSocket(InetAddress inetAddress, int i, InetAddress inetAddress2, int i2) throws IOException { return createSocket(inetAddress.getHostAddress(), i); } @Override // javax.net.ssl.SSLSocketFactory public Socket createSocket(Socket socket, String str, int i, boolean z) throws IOException { Socket createSocket = this.c.getSocketFactory().createSocket(socket, str, i, z); if (createSocket instanceof SSLSocket) { SSLSocket sSLSocket = (SSLSocket) createSocket; Tzr.a(sSLSocket); Tzr.e(sSLSocket); this.a = sSLSocket; this.e = (String[]) sSLSocket.getEnabledCipherSuites().clone(); } return createSocket; } private WCI(Context context) throws NoSuchAlgorithmException, CertificateException, KeyStoreException, IOException, KeyManagementException { this.c = null; if (context == null) { return; } this.b = context.getApplicationContext(); this.c = Tzr.d(); CyF a = SQx.a(context); this.f = a; this.c.init(null, new X509TrustManager[]{a}, null); } @Override // javax.net.ssl.SSLSocketFactory public String[] getSupportedCipherSuites() { String[] strArr = this.e; return strArr != null ? strArr : new String[0]; } @Override // javax.net.ssl.SSLSocketFactory public String[] getDefaultCipherSuites() { return new String[0]; } }