mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
124 lines
6.3 KiB
Java
124 lines
6.3 KiB
Java
|
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 kotlin.Metadata;
|
||
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||
|
import kotlin.jvm.internal.Intrinsics;
|
||
|
import okhttp3.Protocol;
|
||
|
|
||
|
/* compiled from: Jdk9Platform.kt */
|
||
|
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000<\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0016\u0018\u0000 \u00122\u00020\u0001:\u0001\u0012B\u0005¢\u0006\u0002\u0010\u0002J-\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\b2\u0011\u0010\t\u001a\r\u0012\t\u0012\u00070\u000b¢\u0006\u0002\b\f0\nH\u0017J\u0012\u0010\r\u001a\u0004\u0018\u00010\b2\u0006\u0010\u0005\u001a\u00020\u0006H\u0017J\u0012\u0010\u000e\u001a\u0004\u0018\u00010\u000f2\u0006\u0010\u0010\u001a\u00020\u0011H\u0016¨\u0006\u0013"}, d2 = {"Lokhttp3/internal/platform/Jdk9Platform;", "Lokhttp3/internal/platform/Platform;", "()V", "configureTlsExtensions", "", "sslSocket", "Ljavax/net/ssl/SSLSocket;", "hostname", "", "protocols", "", "Lokhttp3/Protocol;", "Lkotlin/jvm/JvmSuppressWildcards;", "getSelectedProtocol", "trustManager", "Ljavax/net/ssl/X509TrustManager;", "sslSocketFactory", "Ljavax/net/ssl/SSLSocketFactory;", "Companion", "okhttp"}, k = 1, mv = {1, 4, 0})
|
||
|
/* loaded from: classes3.dex */
|
||
|
public class Jdk9Platform extends Platform {
|
||
|
|
||
|
/* renamed from: Companion, reason: from kotlin metadata */
|
||
|
public static final Companion INSTANCE = new Companion(0 == true ? 1 : 0);
|
||
|
private static final boolean isAvailable;
|
||
|
|
||
|
@Override // okhttp3.internal.platform.Platform
|
||
|
public void configureTlsExtensions(SSLSocket sslSocket, String hostname, List<Protocol> protocols) {
|
||
|
Intrinsics.checkNotNullParameter(sslSocket, "sslSocket");
|
||
|
Intrinsics.checkNotNullParameter(protocols, "protocols");
|
||
|
SSLParameters sslParameters = sslSocket.getSSLParameters();
|
||
|
List<String> alpnProtocolNames = Platform.INSTANCE.alpnProtocolNames(protocols);
|
||
|
Intrinsics.checkNotNullExpressionValue(sslParameters, "sslParameters");
|
||
|
Object[] array = alpnProtocolNames.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>");
|
||
|
}
|
||
|
|
||
|
@Override // okhttp3.internal.platform.Platform
|
||
|
public String getSelectedProtocol(SSLSocket sslSocket) {
|
||
|
Intrinsics.checkNotNullParameter(sslSocket, "sslSocket");
|
||
|
try {
|
||
|
String applicationProtocol = sslSocket.getApplicationProtocol();
|
||
|
if (applicationProtocol == null) {
|
||
|
return null;
|
||
|
}
|
||
|
if (applicationProtocol.hashCode() == 0) {
|
||
|
if (applicationProtocol.equals("")) {
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
return applicationProtocol;
|
||
|
} catch (UnsupportedOperationException unused) {
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // okhttp3.internal.platform.Platform
|
||
|
public X509TrustManager trustManager(SSLSocketFactory sslSocketFactory) {
|
||
|
Intrinsics.checkNotNullParameter(sslSocketFactory, "sslSocketFactory");
|
||
|
throw new UnsupportedOperationException("clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on JDK 9+");
|
||
|
}
|
||
|
|
||
|
/* compiled from: Jdk9Platform.kt */
|
||
|
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\b\u0010\u0006\u001a\u0004\u0018\u00010\u0007R\u0011\u0010\u0003\u001a\u00020\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0003\u0010\u0005¨\u0006\b"}, d2 = {"Lokhttp3/internal/platform/Jdk9Platform$Companion;", "", "()V", "isAvailable", "", "()Z", "buildIfSupported", "Lokhttp3/internal/platform/Jdk9Platform;", "okhttp"}, k = 1, mv = {1, 4, 0})
|
||
|
/* loaded from: classes3.dex */
|
||
|
public static final class Companion {
|
||
|
private Companion() {
|
||
|
}
|
||
|
|
||
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
||
|
this();
|
||
|
}
|
||
|
|
||
|
public final boolean isAvailable() {
|
||
|
return Jdk9Platform.isAvailable;
|
||
|
}
|
||
|
|
||
|
public final Jdk9Platform buildIfSupported() {
|
||
|
if (isAvailable()) {
|
||
|
return new Jdk9Platform();
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:7:0x001e, 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.INSTANCE = r0
|
||
|
java.lang.String r0 = "java.specification.version"
|
||
|
java.lang.String r0 = java.lang.System.getProperty(r0)
|
||
|
if (r0 == 0) goto L14
|
||
|
java.lang.Integer r1 = kotlin.text.StringsKt.toIntOrNull(r0)
|
||
|
L14:
|
||
|
r0 = 1
|
||
|
r2 = 0
|
||
|
if (r1 == 0) goto L23
|
||
|
int r1 = r1.intValue()
|
||
|
r3 = 9
|
||
|
if (r1 < r3) goto L21
|
||
|
goto L2c
|
||
|
L21:
|
||
|
r0 = r2
|
||
|
goto L2c
|
||
|
L23:
|
||
|
java.lang.Class<javax.net.ssl.SSLSocket> r1 = javax.net.ssl.SSLSocket.class
|
||
|
java.lang.String r3 = "getApplicationProtocol"
|
||
|
java.lang.Class[] r4 = new java.lang.Class[r2] // Catch: java.lang.NoSuchMethodException -> L21
|
||
|
r1.getMethod(r3, r4) // Catch: java.lang.NoSuchMethodException -> L21
|
||
|
L2c:
|
||
|
okhttp3.internal.platform.Jdk9Platform.isAvailable = r0
|
||
|
return
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: okhttp3.internal.platform.Jdk9Platform.<clinit>():void");
|
||
|
}
|
||
|
}
|