content: /*
   * Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty).
   * 
   * Could not load the following classes:
   *  android.net.http.X509TrustManagerExtensions
   */
  package okhttp3.internal.platform.android;
  
  import android.net.http.X509TrustManagerExtensions;
  import java.security.cert.Certificate;
  import java.security.cert.CertificateException;
  import java.security.cert.X509Certificate;
  import java.util.Collection;
  import java.util.List;
  import javax.net.ssl.SSLPeerUnverifiedException;
  import javax.net.ssl.X509TrustManager;
  import kotlin.Metadata;
  import kotlin.jvm.internal.DefaultConstructorMarker;
  import kotlin.jvm.internal.Intrinsics;
  import okhttp3.internal.SuppressSignatureCheck;
  import okhttp3.internal.tls.CertificateChainCleaner;
  import org.jetbrains.annotations.NotNull;
  import org.jetbrains.annotations.Nullable;
  
  @Metadata(mv={1, 4, 0}, bv={1, 0, 3}, k=1, d1={"\u0000>\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\b\u0000\u0018\u0000 \u00132\u00020\u0001:\u0001\u0013B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u00a2\u0006\u0002\u0010\u0006J$\u0010\u0007\u001a\b\u0012\u0004\u0012\u00020\t0\b2\f\u0010\n\u001a\b\u0012\u0004\u0012\u00020\t0\b2\u0006\u0010\u000b\u001a\u00020\fH\u0017J\u0013\u0010\r\u001a\u00020\u000e2\b\u0010\u000f\u001a\u0004\u0018\u00010\u0010H\u0096\u0002J\b\u0010\u0011\u001a\u00020\u0012H\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u0014"}, d2={"Lokhttp3/internal/platform/android/AndroidCertificateChainCleaner;", "Lokhttp3/internal/tls/CertificateChainCleaner;", "trustManager", "Ljavax/net/ssl/X509TrustManager;", "x509TrustManagerExtensions", "Landroid/net/http/X509TrustManagerExtensions;", "(Ljavax/net/ssl/X509TrustManager;Landroid/net/http/X509TrustManagerExtensions;)V", "clean", "", "Ljava/security/cert/Certificate;", "chain", "hostname", "", "equals", "", "other", "", "hashCode", "", "Companion", "okhttp"})
  public final class AndroidCertificateChainCleaner
  extends CertificateChainCleaner {
      private final X509TrustManager trustManager;
      private final X509TrustManagerExtensions x509TrustManagerExtensions;
      public static final Companion Companion = new Companion(null);
  
      @Override
      @SuppressSignatureCheck
      @NotNull
      public List<Certificate> clean(@NotNull List<? extends Certificate> chain, @NotNull String hostname) throws SSLPeerUnverifiedException {
          Intrinsics.checkNotNullParameter(chain, "chain");
          Intrinsics.checkNotNullParameter(hostname, "hostname");
          Collection $this$toTypedArray$iv = chain;
          boolean $i$f$toTypedArray = false;
          Collection thisCollection$iv = $this$toTypedArray$iv;
          X509Certificate[] x509CertificateArray = thisCollection$iv.toArray(new X509Certificate[0]);
          if (x509CertificateArray == null) {
              throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T>");
          }
          X509Certificate[] certificates = x509CertificateArray;
          try {
              List list = this.x509TrustManagerExtensions.checkServerTrusted(certificates, "RSA", hostname);
              Intrinsics.checkNotNullExpressionValue(list, "x509TrustManagerExtensio\u2026ficates, \"RSA\", hostname)");
              return list;
          } catch (CertificateException ce) {
              SSLPeerUnverifiedException sSLPeerUnverifiedException = new SSLPeerUnverifiedException(ce.getMessage());
              boolean bl = false;
              boolean bl2 = false;
              SSLPeerUnverifiedException $this$apply = sSLPeerUnverifiedException;
              boolean bl3 = false;
              $this$apply.initCause(ce);
              throw (Throwable)sSLPeerUnverifiedException;
          }
      }
  
      public boolean equals(@Nullable Object other) {
          return other instanceof AndroidCertificateChainCleaner && ((AndroidCertificateChainCleaner)other).trustManager == this.trustManager;
      }
  
      public int hashCode() {
          return System.identityHashCode(this.trustManager);
      }
  
      public AndroidCertificateChainCleaner(@NotNull X509TrustManager trustManager, @NotNull X509TrustManagerExtensions x509TrustManagerExtensions) {
          Intrinsics.checkNotNullParameter(trustManager, "trustManager");
          Intrinsics.checkNotNullParameter(x509TrustManagerExtensions, "x509TrustManagerExtensions");
          this.trustManager = trustManager;
          this.x509TrustManagerExtensions = x509TrustManagerExtensions;
      }
  
      @Metadata(mv={1, 4, 0}, bv={1, 0, 3}, k=1, d1={"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002\u00a2\u0006\u0002\u0010\u0002J\u0012\u0010\u0003\u001a\u0004\u0018\u00010\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007\u00a8\u0006\u0007"}, d2={"Lokhttp3/internal/platform/android/AndroidCertificateChainCleaner$Companion;", "", "()V", "buildIfSupported", "Lokhttp3/internal/platform/android/AndroidCertificateChainCleaner;", "trustManager", "Ljavax/net/ssl/X509TrustManager;", "okhttp"})
      public static final class Companion {
          @SuppressSignatureCheck
          @Nullable
          public final AndroidCertificateChainCleaner buildIfSupported(@NotNull X509TrustManager trustManager) {
              X509TrustManagerExtensions x509TrustManagerExtensions;
              Intrinsics.checkNotNullParameter(trustManager, "trustManager");
              try {
                  x509TrustManagerExtensions = new X509TrustManagerExtensions(trustManager);
              } catch (IllegalArgumentException iae) {
                  x509TrustManagerExtensions = null;
              }
              X509TrustManagerExtensions extensions = x509TrustManagerExtensions;
              return extensions != null ? new AndroidCertificateChainCleaner(trustManager, extensions) : null;
          }
  
          private Companion() {
          }
  
          public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
              this();
          }
      }
  }
  
  