content: /*
   * Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty).
   * 
   * Could not load the following classes:
   *  org.conscrypt.Conscrypt
   */
  package okhttp3.internal.platform.android;
  
  import java.util.Collection;
  import java.util.List;
  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;
  import okhttp3.internal.platform.ConscryptPlatform;
  import okhttp3.internal.platform.Platform;
  import okhttp3.internal.platform.android.DeferredSocketAdapter;
  import okhttp3.internal.platform.android.SocketAdapter;
  import org.conscrypt.Conscrypt;
  import org.jetbrains.annotations.NotNull;
  import org.jetbrains.annotations.Nullable;
  
  @Metadata(mv={1, 4, 0}, bv={1, 0, 3}, k=1, d1={"\u00002\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\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0003\u0018\u0000 \u00102\u00020\u0001:\u0001\u0010B\u0005\u00a2\u0006\u0002\u0010\u0002J(\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\b2\f\u0010\t\u001a\b\u0012\u0004\u0012\u00020\u000b0\nH\u0016J\u0012\u0010\f\u001a\u0004\u0018\u00010\b2\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\b\u0010\r\u001a\u00020\u000eH\u0016J\u0010\u0010\u000f\u001a\u00020\u000e2\u0006\u0010\u0005\u001a\u00020\u0006H\u0016\u00a8\u0006\u0011"}, d2={"Lokhttp3/internal/platform/android/ConscryptSocketAdapter;", "Lokhttp3/internal/platform/android/SocketAdapter;", "()V", "configureTlsExtensions", "", "sslSocket", "Ljavax/net/ssl/SSLSocket;", "hostname", "", "protocols", "", "Lokhttp3/Protocol;", "getSelectedProtocol", "isSupported", "", "matchesSocket", "Companion", "okhttp"})
  public final class ConscryptSocketAdapter
  implements SocketAdapter {
      @NotNull
      private static final DeferredSocketAdapter.Factory factory;
      public static final Companion Companion;
  
      @Override
      public boolean matchesSocket(@NotNull SSLSocket sslSocket) {
          Intrinsics.checkNotNullParameter(sslSocket, "sslSocket");
          return Conscrypt.isConscrypt((SSLSocket)sslSocket);
      }
  
      @Override
      public boolean isSupported() {
          return ConscryptPlatform.Companion.isSupported();
      }
  
      @Override
      @Nullable
      public String getSelectedProtocol(@NotNull SSLSocket sslSocket) {
          Intrinsics.checkNotNullParameter(sslSocket, "sslSocket");
          return this.matchesSocket(sslSocket) ? Conscrypt.getApplicationProtocol((SSLSocket)sslSocket) : null;
      }
  
      @Override
      public void configureTlsExtensions(@NotNull SSLSocket sslSocket, @Nullable String hostname, @NotNull List<? extends Protocol> protocols) {
          Intrinsics.checkNotNullParameter(sslSocket, "sslSocket");
          Intrinsics.checkNotNullParameter(protocols, "protocols");
          if (this.matchesSocket(sslSocket)) {
              Conscrypt.setUseSessionTickets((SSLSocket)sslSocket, (boolean)true);
              List<String> names = Platform.Companion.alpnProtocolNames(protocols);
              Collection $this$toTypedArray$iv = names;
              boolean $i$f$toTypedArray = false;
              Collection thisCollection$iv = $this$toTypedArray$iv;
              String[] stringArray = thisCollection$iv.toArray(new String[0]);
              if (stringArray == null) {
                  throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T>");
              }
              Conscrypt.setApplicationProtocols((SSLSocket)sslSocket, (String[])stringArray);
          }
      }
  
      static {
          Companion = new Companion(null);
          factory = new DeferredSocketAdapter.Factory(){
  
              public boolean matchesSocket(@NotNull SSLSocket sslSocket) {
                  Intrinsics.checkNotNullParameter(sslSocket, "sslSocket");
                  return ConscryptPlatform.Companion.isSupported() && Conscrypt.isConscrypt((SSLSocket)sslSocket);
              }
  
              @NotNull
              public SocketAdapter create(@NotNull SSLSocket sslSocket) {
                  Intrinsics.checkNotNullParameter(sslSocket, "sslSocket");
                  return new ConscryptSocketAdapter();
              }
          };
      }
  
      @Override
      @Nullable
      public X509TrustManager trustManager(@NotNull SSLSocketFactory sslSocketFactory) {
          Intrinsics.checkNotNullParameter(sslSocketFactory, "sslSocketFactory");
          return SocketAdapter.DefaultImpls.trustManager(this, sslSocketFactory);
      }
  
      @Override
      public boolean matchesSocketFactory(@NotNull SSLSocketFactory sslSocketFactory) {
          Intrinsics.checkNotNullParameter(sslSocketFactory, "sslSocketFactory");
          return SocketAdapter.DefaultImpls.matchesSocketFactory(this, sslSocketFactory);
      }
  
      @Metadata(mv={1, 4, 0}, bv={1, 0, 3}, k=1, d1={"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002\u00a2\u0006\u0002\u0010\u0002R\u0011\u0010\u0003\u001a\u00020\u0004\u00a2\u0006\b\n\u0000\u001a\u0004\b\u0005\u0010\u0006\u00a8\u0006\u0007"}, d2={"Lokhttp3/internal/platform/android/ConscryptSocketAdapter$Companion;", "", "()V", "factory", "Lokhttp3/internal/platform/android/DeferredSocketAdapter$Factory;", "getFactory", "()Lokhttp3/internal/platform/android/DeferredSocketAdapter$Factory;", "okhttp"})
      public static final class Companion {
          @NotNull
          public final DeferredSocketAdapter.Factory getFactory() {
              return factory;
          }
  
          private Companion() {
          }
  
          public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
              this();
          }
      }
  }
  
  