.class public final Lc0/g; .super Ljava/lang/Object; .source "CertificatePinner.kt" # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Lc0/g$b;, Lc0/g$a; } .end annotation # static fields .field public static final c:Lc0/g; .field public static final d:Lc0/g$a; # instance fields .field public final a:Ljava/util/Set; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/Set<", "Lc0/g$b;", ">;" } .end annotation .end field .field public final b:Lc0/g0/m/c; # direct methods .method public static constructor ()V .locals 4 new-instance v0, Lc0/g$a; const/4 v1, 0x0 invoke-direct {v0, v1}, Lc0/g$a;->(Lkotlin/jvm/internal/DefaultConstructorMarker;)V sput-object v0, Lc0/g;->d:Lc0/g$a; new-instance v0, Ljava/util/ArrayList; invoke-direct {v0}, Ljava/util/ArrayList;->()V new-instance v2, Lc0/g; invoke-static {v0}, Ly/h/f;->toSet(Ljava/lang/Iterable;)Ljava/util/Set; move-result-object v0 const/4 v3, 0x2 invoke-direct {v2, v0, v1, v3}, Lc0/g;->(Ljava/util/Set;Lc0/g0/m/c;I)V sput-object v2, Lc0/g;->c:Lc0/g; return-void .end method .method public constructor (Ljava/util/Set;Lc0/g0/m/c;)V .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/Set<", "Lc0/g$b;", ">;", "Lc0/g0/m/c;", ")V" } .end annotation const-string v0, "pins" invoke-static {p1, v0}, Ly/m/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V invoke-direct {p0}, Ljava/lang/Object;->()V iput-object p1, p0, Lc0/g;->a:Ljava/util/Set; iput-object p2, p0, Lc0/g;->b:Lc0/g0/m/c; return-void .end method .method public constructor (Ljava/util/Set;Lc0/g0/m/c;I)V .locals 0 and-int/lit8 p2, p3, 0x2 const/4 p2, 0x0 const-string p3, "pins" invoke-static {p1, p3}, Ly/m/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V invoke-direct {p0}, Ljava/lang/Object;->()V iput-object p1, p0, Lc0/g;->a:Ljava/util/Set; iput-object p2, p0, Lc0/g;->b:Lc0/g0/m/c; return-void .end method # virtual methods .method public final a(Ljava/lang/String;Lkotlin/jvm/functions/Function0;)V .locals 8 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/lang/String;", "Lkotlin/jvm/functions/Function0<", "+", "Ljava/util/List<", "+", "Ljava/security/cert/X509Certificate;", ">;>;)V" } .end annotation const-string v0, "hostname" invoke-static {p1, v0}, Ly/m/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V const-string v1, "cleanedPeerCertificatesFn" invoke-static {p2, v1}, Ly/m/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V invoke-static {p1, v0}, Ly/m/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V iget-object v1, p0, Lc0/g;->a:Ljava/util/Set; sget-object v2, Ly/h/l;->d:Ly/h/l; invoke-interface {v1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator; move-result-object v1 :cond_0 :goto_0 invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z move-result v3 const/4 v4, 0x0 const/4 v5, 0x0 if-eqz v3, :cond_6 invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v3 move-object v6, v3 check-cast v6, Lc0/g$b; invoke-static {v6}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object; invoke-static {p1, v0}, Ly/m/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V const/4 v6, 0x2 const-string v7, "**." invoke-static {v5, v7, v4, v6}, Ly/s/k;->startsWith$default(Ljava/lang/String;Ljava/lang/String;ZI)Z move-result v7 if-nez v7, :cond_5 const-string v7, "*." invoke-static {v5, v7, v4, v6}, Ly/s/k;->startsWith$default(Ljava/lang/String;Ljava/lang/String;ZI)Z move-result v4 if-nez v4, :cond_4 invoke-static {p1, v5}, Ly/m/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v4 if-eqz v4, :cond_0 invoke-interface {v2}, Ljava/util/List;->isEmpty()Z move-result v4 if-eqz v4, :cond_1 new-instance v2, Ljava/util/ArrayList; invoke-direct {v2}, Ljava/util/ArrayList;->()V :cond_1 instance-of v4, v2, Ly/m/c/x/a; if-eqz v4, :cond_3 instance-of v4, v2, Ly/m/c/x/c; if-eqz v4, :cond_2 goto :goto_1 :cond_2 const-string p1, "kotlin.collections.MutableList" invoke-static {v2, p1}, Ly/m/c/w;->throwCce(Ljava/lang/Object;Ljava/lang/String;)V throw v5 :cond_3 :goto_1 invoke-interface {v2, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z goto :goto_0 :cond_4 throw v5 :cond_5 throw v5 :cond_6 invoke-interface {v2}, Ljava/util/List;->isEmpty()Z move-result v0 if-eqz v0, :cond_7 return-void :cond_7 invoke-interface {p2}, Lkotlin/jvm/functions/Function0;->invoke()Ljava/lang/Object; move-result-object p2 check-cast p2, Ljava/util/List; invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator; move-result-object v0 :goto_2 invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z move-result v1 if-eqz v1, :cond_9 invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v1 check-cast v1, Ljava/security/cert/X509Certificate; invoke-interface {v2}, Ljava/util/List;->iterator()Ljava/util/Iterator; move-result-object v1 invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z move-result v3 if-nez v3, :cond_8 goto :goto_2 :cond_8 invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object p1 check-cast p1, Lc0/g$b; invoke-static {p1}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object; throw v5 :cond_9 const-string v0, "Certificate pinning failure!" const-string v1, "\n Peer certificate chain:" invoke-static {v0, v1}, Lf/e/c/a/a;->L(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator; move-result-object p2 :goto_3 invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z move-result v1 const-string v3, "\n " if-eqz v1, :cond_a invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v1 check-cast v1, Ljava/security/cert/X509Certificate; invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const-string v3, "certificate" invoke-static {v1, v3}, Ly/m/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3}, Ljava/lang/StringBuilder;->()V const-string v5, "sha256/" invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const-string v5, "$this$sha256Hash" invoke-static {v1, v5}, Ly/m/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V sget-object v5, Lokio/ByteString;->g:Lokio/ByteString$a; invoke-virtual {v1}, Ljava/security/cert/X509Certificate;->getPublicKey()Ljava/security/PublicKey; move-result-object v6 const-string v7, "publicKey" invoke-static {v6, v7}, Ly/m/c/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V invoke-interface {v6}, Ljava/security/PublicKey;->getEncoded()[B move-result-object v6 const-string v7, "publicKey.encoded" invoke-static {v6, v7}, Ly/m/c/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V const/4 v7, 0x3 invoke-static {v5, v6, v4, v4, v7}, Lokio/ByteString$a;->c(Lokio/ByteString$a;[BIII)Lokio/ByteString; move-result-object v5 const-string v6, "SHA-256" invoke-virtual {v5, v6}, Lokio/ByteString;->g(Ljava/lang/String;)Lokio/ByteString; move-result-object v5 invoke-virtual {v5}, Lokio/ByteString;->f()Ljava/lang/String; move-result-object v5 invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v3 invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const-string v3, ": " invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v1}, Ljava/security/cert/X509Certificate;->getSubjectDN()Ljava/security/Principal; move-result-object v1 const-string v3, "element.subjectDN" invoke-static {v1, v3}, Ly/m/c/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V invoke-interface {v1}, Ljava/security/Principal;->getName()Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; goto :goto_3 :cond_a const-string p2, "\n Pinned certificates for " invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const-string p1, ":" invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-interface {v2}, Ljava/util/List;->iterator()Ljava/util/Iterator; move-result-object p1 :goto_4 invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z move-result p2 if-eqz p2, :cond_b invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object p2 check-cast p2, Lc0/g$b; invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; goto :goto_4 :cond_b invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 const-string p2, "StringBuilder().apply(builderAction).toString()" invoke-static {p1, p2}, Ly/m/c/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V new-instance p2, Ljavax/net/ssl/SSLPeerUnverifiedException; invoke-direct {p2, p1}, Ljavax/net/ssl/SSLPeerUnverifiedException;->(Ljava/lang/String;)V throw p2 .end method .method public final b(Lc0/g0/m/c;)Lc0/g; .locals 2 const-string v0, "certificateChainCleaner" invoke-static {p1, v0}, Ly/m/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V iget-object v0, p0, Lc0/g;->b:Lc0/g0/m/c; invoke-static {v0, p1}, Ly/m/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 move-object v0, p0 goto :goto_0 :cond_0 new-instance v0, Lc0/g; iget-object v1, p0, Lc0/g;->a:Ljava/util/Set; invoke-direct {v0, v1, p1}, Lc0/g;->(Ljava/util/Set;Lc0/g0/m/c;)V :goto_0 return-object v0 .end method .method public equals(Ljava/lang/Object;)Z .locals 2 instance-of v0, p1, Lc0/g; if-eqz v0, :cond_0 check-cast p1, Lc0/g; iget-object v0, p1, Lc0/g;->a:Ljava/util/Set; iget-object v1, p0, Lc0/g;->a:Ljava/util/Set; invoke-static {v0, v1}, Ly/m/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 iget-object p1, p1, Lc0/g;->b:Lc0/g0/m/c; iget-object v0, p0, Lc0/g;->b:Lc0/g0/m/c; invoke-static {p1, v0}, Ly/m/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result p1 if-eqz p1, :cond_0 const/4 p1, 0x1 goto :goto_0 :cond_0 const/4 p1, 0x0 :goto_0 return p1 .end method .method public hashCode()I .locals 2 iget-object v0, p0, Lc0/g;->a:Ljava/util/Set; invoke-virtual {v0}, Ljava/lang/Object;->hashCode()I move-result v0 add-int/lit16 v0, v0, 0x5ed mul-int/lit8 v0, v0, 0x29 iget-object v1, p0, Lc0/g;->b:Lc0/g0/m/c; if-eqz v1, :cond_0 invoke-virtual {v1}, Ljava/lang/Object;->hashCode()I move-result v1 goto :goto_0 :cond_0 const/4 v1, 0x0 :goto_0 add-int/2addr v0, v1 return v0 .end method