645 lines
15 KiB
Smali
645 lines
15 KiB
Smali
.class public final Lokhttp3/h;
|
|
.super Ljava/lang/Object;
|
|
.source "CertificatePinner.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lokhttp3/h$c;,
|
|
Lokhttp3/h$a;,
|
|
Lokhttp3/h$b;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final boA:Lokhttp3/h;
|
|
|
|
.field public static final boB:Lokhttp3/h$b;
|
|
|
|
|
|
# instance fields
|
|
.field final boy:Ljava/util/Set;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Set<",
|
|
"Lokhttp3/h$c;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final boz:Lokhttp3/internal/i/c;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 3
|
|
|
|
new-instance v0, Lokhttp3/h$b;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lokhttp3/h$b;-><init>(B)V
|
|
|
|
sput-object v0, Lokhttp3/h;->boB:Lokhttp3/h$b;
|
|
|
|
new-instance v0, Lokhttp3/h$a;
|
|
|
|
invoke-direct {v0}, Lokhttp3/h$a;-><init>()V
|
|
|
|
new-instance v1, Lokhttp3/h;
|
|
|
|
iget-object v0, v0, Lokhttp3/h$a;->beW:Ljava/util/List;
|
|
|
|
check-cast v0, Ljava/lang/Iterable;
|
|
|
|
invoke-static {v0}, Lkotlin/a/m;->toSet(Ljava/lang/Iterable;)Ljava/util/Set;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-direct {v1, v0, v2}, Lokhttp3/h;-><init>(Ljava/util/Set;Lokhttp3/internal/i/c;)V
|
|
|
|
sput-object v1, Lokhttp3/h;->boA:Lokhttp3/h;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Ljava/util/Set;Lokhttp3/internal/i/c;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Set<",
|
|
"Lokhttp3/h$c;",
|
|
">;",
|
|
"Lokhttp3/internal/i/c;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "pins"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lokhttp3/h;->boy:Ljava/util/Set;
|
|
|
|
iput-object p2, p0, Lokhttp3/h;->boz:Lokhttp3/internal/i/c;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final a(Ljava/lang/String;Lkotlin/jvm/functions/Function0;)V
|
|
.locals 21
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
"Lkotlin/jvm/functions/Function0<",
|
|
"+",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Ljava/security/cert/X509Certificate;",
|
|
">;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
move-object/from16 v6, p1
|
|
|
|
const-string v7, "hostname"
|
|
|
|
invoke-static {v6, v7}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "cleanedPeerCertificatesFn"
|
|
|
|
move-object/from16 v8, p2
|
|
|
|
invoke-static {v8, v0}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v6, v7}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {}, Lkotlin/a/m;->emptyList()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
move-object/from16 v9, p0
|
|
|
|
iget-object v1, v9, Lokhttp3/h;->boy:Ljava/util/Set;
|
|
|
|
invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v10
|
|
|
|
move-object v11, v0
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {v10}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
invoke-interface {v10}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
move-object v12, v0
|
|
|
|
check-cast v12, Lokhttp3/h$c;
|
|
|
|
invoke-static {v6, v7}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iget-object v0, v12, Lokhttp3/h$c;->pattern:Ljava/lang/String;
|
|
|
|
const/4 v2, 0x2
|
|
|
|
const/4 v13, 0x0
|
|
|
|
const-string v3, "*."
|
|
|
|
invoke-static {v0, v3, v13, v2, v1}, Lkotlin/text/l;->startsWith$default(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v14, 0x1
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
move-object v15, v6
|
|
|
|
check-cast v15, Ljava/lang/CharSequence;
|
|
|
|
const/16 v16, 0x2e
|
|
|
|
const/16 v17, 0x0
|
|
|
|
const/16 v18, 0x0
|
|
|
|
const/16 v19, 0x6
|
|
|
|
const/16 v20, 0x0
|
|
|
|
invoke-static/range {v15 .. v20}, Lkotlin/text/l;->indexOf$default(Ljava/lang/CharSequence;CIZILjava/lang/Object;)I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual/range {p1 .. p1}, Ljava/lang/String;->length()I
|
|
|
|
move-result v1
|
|
|
|
sub-int/2addr v1, v0
|
|
|
|
sub-int/2addr v1, v14
|
|
|
|
iget-object v2, v12, Lokhttp3/h$c;->boC:Ljava/lang/String;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/String;->length()I
|
|
|
|
move-result v2
|
|
|
|
if-ne v1, v2, :cond_2
|
|
|
|
iget-object v1, v12, Lokhttp3/h$c;->boC:Ljava/lang/String;
|
|
|
|
add-int/lit8 v2, v0, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x4
|
|
|
|
const/4 v5, 0x0
|
|
|
|
move-object/from16 v0, p1
|
|
|
|
invoke-static/range {v0 .. v5}, Lkotlin/text/l;->startsWith$default(Ljava/lang/String;Ljava/lang/String;IZILjava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
const/4 v13, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
iget-object v0, v12, Lokhttp3/h$c;->boC:Ljava/lang/String;
|
|
|
|
invoke-static {v6, v0}, Lkotlin/jvm/internal/l;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v13
|
|
|
|
:cond_2
|
|
:goto_1
|
|
if-eqz v13, :cond_0
|
|
|
|
invoke-interface {v11}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
move-object v11, v0
|
|
|
|
check-cast v11, Ljava/util/List;
|
|
|
|
:cond_3
|
|
if-eqz v11, :cond_4
|
|
|
|
invoke-static {v11}, Lkotlin/jvm/internal/ac;->asMutableList(Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0, v12}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
new-instance v0, Lkotlin/r;
|
|
|
|
const-string v1, "null cannot be cast to non-null type kotlin.collections.MutableList<okhttp3.CertificatePinner.Pin>"
|
|
|
|
invoke-direct {v0, v1}, Lkotlin/r;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_5
|
|
invoke-interface {v11}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_6
|
|
|
|
return-void
|
|
|
|
:cond_6
|
|
invoke-interface/range {p2 .. p2}, Lkotlin/jvm/functions/Function0;->invoke()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:cond_7
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_d
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Ljava/security/cert/X509Certificate;
|
|
|
|
invoke-interface {v11}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v4
|
|
|
|
move-object v5, v1
|
|
|
|
move-object v7, v5
|
|
|
|
:cond_8
|
|
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v8
|
|
|
|
if-eqz v8, :cond_7
|
|
|
|
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v8
|
|
|
|
check-cast v8, Lokhttp3/h$c;
|
|
|
|
iget-object v10, v8, Lokhttp3/h$c;->boD:Ljava/lang/String;
|
|
|
|
invoke-virtual {v10}, Ljava/lang/String;->hashCode()I
|
|
|
|
move-result v12
|
|
|
|
const v13, 0x68547ca
|
|
|
|
if-eq v12, v13, :cond_a
|
|
|
|
const v13, 0x7a530ee8
|
|
|
|
if-ne v12, v13, :cond_c
|
|
|
|
const-string v12, "sha256/"
|
|
|
|
invoke-virtual {v10, v12}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v10
|
|
|
|
if-eqz v10, :cond_c
|
|
|
|
if-nez v7, :cond_9
|
|
|
|
invoke-static {v3}, Lokhttp3/h$b;->d(Ljava/security/cert/X509Certificate;)Lokio/ByteString;
|
|
|
|
move-result-object v7
|
|
|
|
:cond_9
|
|
iget-object v8, v8, Lokhttp3/h$c;->boE:Lokio/ByteString;
|
|
|
|
invoke-static {v8, v7}, Lkotlin/jvm/internal/l;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v8
|
|
|
|
if-eqz v8, :cond_8
|
|
|
|
return-void
|
|
|
|
:cond_a
|
|
const-string v12, "sha1/"
|
|
|
|
invoke-virtual {v10, v12}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v10
|
|
|
|
if-eqz v10, :cond_c
|
|
|
|
if-nez v5, :cond_b
|
|
|
|
const-string v5, "$this$toSha1ByteString"
|
|
|
|
invoke-static {v3, v5}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
sget-object v5, Lokio/ByteString;->bBL:Lokio/ByteString$a;
|
|
|
|
invoke-virtual {v3}, Ljava/security/cert/X509Certificate;->getPublicKey()Ljava/security/PublicKey;
|
|
|
|
move-result-object v5
|
|
|
|
const-string v10, "publicKey"
|
|
|
|
invoke-static {v5, v10}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-interface {v5}, Ljava/security/PublicKey;->getEncoded()[B
|
|
|
|
move-result-object v5
|
|
|
|
const-string v10, "publicKey.encoded"
|
|
|
|
invoke-static {v5, v10}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v5}, Lokio/ByteString$a;->E([B)Lokio/ByteString;
|
|
|
|
move-result-object v5
|
|
|
|
const-string v10, "SHA-1"
|
|
|
|
invoke-virtual {v5, v10}, Lokio/ByteString;->eu(Ljava/lang/String;)Lokio/ByteString;
|
|
|
|
move-result-object v5
|
|
|
|
:cond_b
|
|
iget-object v8, v8, Lokhttp3/h$c;->boE:Lokio/ByteString;
|
|
|
|
invoke-static {v8, v5}, Lkotlin/jvm/internal/l;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v8
|
|
|
|
if-eqz v8, :cond_8
|
|
|
|
return-void
|
|
|
|
:cond_c
|
|
new-instance v0, Ljava/lang/AssertionError;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "unsupported hashAlgorithm: "
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
iget-object v2, v8, Lokhttp3/h$c;->boD:Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
|
|
|
|
check-cast v0, Ljava/lang/Throwable;
|
|
|
|
throw v0
|
|
|
|
:cond_d
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "Certificate pinning failure!"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "\n Peer certificate chain:"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_2
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
const-string v3, "\n "
|
|
|
|
if-eqz v2, :cond_f
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/security/cert/X509Certificate;
|
|
|
|
if-eqz v2, :cond_e
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-object v3, v2
|
|
|
|
check-cast v3, Ljava/security/cert/Certificate;
|
|
|
|
invoke-static {v3}, Lokhttp3/h$b;->a(Ljava/security/cert/Certificate;)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, ": "
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/security/cert/X509Certificate;->getSubjectDN()Ljava/security/Principal;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "x509Certificate.subjectDN"
|
|
|
|
invoke-static {v2, v3}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-interface {v2}, Ljava/security/Principal;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
goto :goto_2
|
|
|
|
:cond_e
|
|
new-instance v0, Lkotlin/r;
|
|
|
|
const-string v1, "null cannot be cast to non-null type java.security.cert.X509Certificate"
|
|
|
|
invoke-direct {v0, v1}, Lkotlin/r;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_f
|
|
const-string v0, "\n Pinned certificates for "
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, ":"
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-interface {v11}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_3
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_10
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lokhttp3/h$c;
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
goto :goto_3
|
|
|
|
:cond_10
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "StringBuilder().apply(builderAction).toString()"
|
|
|
|
invoke-static {v0, v1}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v1, Ljavax/net/ssl/SSLPeerUnverifiedException;
|
|
|
|
invoke-direct {v1, v0}, Ljavax/net/ssl/SSLPeerUnverifiedException;-><init>(Ljava/lang/String;)V
|
|
|
|
check-cast v1, Ljava/lang/Throwable;
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method public final equals(Ljava/lang/Object;)Z
|
|
.locals 2
|
|
|
|
instance-of v0, p1, Lokhttp3/h;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
check-cast p1, Lokhttp3/h;
|
|
|
|
iget-object v0, p1, Lokhttp3/h;->boy:Ljava/util/Set;
|
|
|
|
iget-object v1, p0, Lokhttp3/h;->boy:Ljava/util/Set;
|
|
|
|
invoke-static {v0, v1}, Lkotlin/jvm/internal/l;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object p1, p1, Lokhttp3/h;->boz:Lokhttp3/internal/i/c;
|
|
|
|
iget-object v0, p0, Lokhttp3/h;->boz:Lokhttp3/internal/i/c;
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/l;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public final hashCode()I
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lokhttp3/h;->boy: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, Lokhttp3/h;->boz:Lokhttp3/internal/i/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
|