content: 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 kotlin.text.StringsKt;
  import mt.Log1F380D;
  import okhttp3.HttpUrl;
  import okhttp3.Protocol;
  
  @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})
  /* compiled from: 01DB */
  public class Jdk9Platform extends Platform {
      public static final Companion Companion = new Companion((DefaultConstructorMarker) null);
      /* access modifiers changed from: private */
      public static final boolean isAvailable;
  
      @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\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})
      /* compiled from: Jdk9Platform.kt */
      public static final class Companion {
          private Companion() {
          }
  
          public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
              this();
          }
  
          public final Jdk9Platform buildIfSupported() {
              if (isAvailable()) {
                  return new Jdk9Platform();
              }
              return null;
          }
  
          public final boolean isAvailable() {
              return Jdk9Platform.isAvailable;
          }
      }
  
      static {
          Integer num = null;
          String property = System.getProperty("java.specification.version");
          Log1F380D.a((Object) property);
          if (property != null) {
              num = StringsKt.toIntOrNull(property);
          }
          boolean z = true;
          if (num == null) {
              try {
                  SSLSocket.class.getMethod("getApplicationProtocol", new Class[0]);
              } catch (NoSuchMethodException e) {
                  z = false;
              }
          } else if (num.intValue() < 9) {
              z = false;
          }
          isAvailable = z;
      }
  
      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.Companion.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>");
      }
  
      public String getSelectedProtocol(SSLSocket sslSocket) {
          Intrinsics.checkNotNullParameter(sslSocket, "sslSocket");
          try {
              String applicationProtocol = sslSocket.getApplicationProtocol();
              if (applicationProtocol == null) {
                  return null;
              }
              String str = applicationProtocol;
              switch (applicationProtocol.hashCode()) {
                  case 0:
                      if (applicationProtocol.equals(HttpUrl.FRAGMENT_ENCODE_SET)) {
                          String str2 = str;
                          return null;
                      }
                      break;
              }
              return str;
          } catch (UnsupportedOperationException e) {
              return null;
          }
      }
  
      public X509TrustManager trustManager(SSLSocketFactory sslSocketFactory) {
          Intrinsics.checkNotNullParameter(sslSocketFactory, "sslSocketFactory");
          throw new UnsupportedOperationException("clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on JDK 9+");
      }
  }
  