what-the-bank/sources/okhttp3/internal/platform/Jdk9Platform.java

113 lines
4.0 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package okhttp3.internal.platform;
import java.util.List;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;
import o.C14953gcr;
import o.C14957gcv;
import okhttp3.Protocol;
/* loaded from: classes.dex */
public class Jdk9Platform extends Platform {
public static final Companion Companion = new Companion(0 == true ? 1 : 0);
private static final boolean isAvailable;
@Override // okhttp3.internal.platform.Platform
public void configureTlsExtensions(SSLSocket sSLSocket, String str, List<Protocol> list) {
C14957gcv.e(sSLSocket, "");
C14957gcv.e(list, "");
SSLParameters sSLParameters = sSLSocket.getSSLParameters();
Object[] array = Platform.Companion.alpnProtocolNames(list).toArray(new String[0]);
if (array != null) {
sSLParameters.setApplicationProtocols((String[]) array);
sSLSocket.setSSLParameters(sSLParameters);
return;
}
throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T of kotlin.collections.ArraysKt__ArraysJVMKt.toTypedArray>");
}
@Override // okhttp3.internal.platform.Platform
public String getSelectedProtocol(SSLSocket sSLSocket) {
C14957gcv.e(sSLSocket, "");
try {
String applicationProtocol = sSLSocket.getApplicationProtocol();
if (applicationProtocol == null) {
return null;
}
if (C14957gcv.b((Object) applicationProtocol, (Object) "")) {
return null;
}
return applicationProtocol;
} catch (UnsupportedOperationException unused) {
return null;
}
}
@Override // okhttp3.internal.platform.Platform
public X509TrustManager trustManager(SSLSocketFactory sSLSocketFactory) {
C14957gcv.e(sSLSocketFactory, "");
throw new UnsupportedOperationException("clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on JDK 9+");
}
/* loaded from: classes.dex */
public static final class Companion {
private Companion() {
}
public final boolean isAvailable() {
return Jdk9Platform.isAvailable;
}
public final Jdk9Platform buildIfSupported() {
if (isAvailable()) {
return new Jdk9Platform();
}
return null;
}
public /* synthetic */ Companion(C14953gcr c14953gcr) {
this();
}
}
/* JADX WARN: Code restructure failed: missing block: B:7:0x0022, code lost:
if (r1.intValue() < 9) goto L12;
*/
/* JADX WARN: Multi-variable type inference failed */
static {
/*
okhttp3.internal.platform.Jdk9Platform$Companion r0 = new okhttp3.internal.platform.Jdk9Platform$Companion
r1 = 0
r0.<init>(r1)
okhttp3.internal.platform.Jdk9Platform.Companion = r0
java.lang.String r0 = "java.specification.version"
java.lang.String r0 = java.lang.System.getProperty(r0)
if (r0 == 0) goto L19
java.lang.String r1 = ""
o.C14957gcv.e(r0, r1)
java.lang.Integer r1 = o.gdZ.b(r0)
L19:
r0 = 0
if (r1 == 0) goto L25
int r1 = r1.intValue()
r2 = 9
if (r1 >= r2) goto L2e
goto L2f
L25:
java.lang.Class[] r1 = new java.lang.Class[r0] // Catch: java.lang.NoSuchMethodException -> L2f
java.lang.Class<javax.net.ssl.SSLSocket> r2 = javax.net.ssl.SSLSocket.class
java.lang.String r3 = "getApplicationProtocol"
r2.getMethod(r3, r1) // Catch: java.lang.NoSuchMethodException -> L2f
L2e:
r0 = 1
L2f:
okhttp3.internal.platform.Jdk9Platform.isAvailable = r0
return
*/
throw new UnsupportedOperationException("Method not decompiled: okhttp3.internal.platform.Jdk9Platform.<clinit>():void");
}
}