apkfuckery/com.discord/smali_classes2/q/g.smali

637 lines
13 KiB
Smali
Raw Normal View History

2019-12-20 07:00:35 +00:00
.class public final Lq/g;
2019-12-06 03:29:40 +00:00
.super Ljava/lang/Object;
.source "CertificatePinner.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
2019-12-20 07:00:35 +00:00
Lq/g$b;,
Lq/g$a;
2019-12-06 03:29:40 +00:00
}
.end annotation
# static fields
2019-12-20 07:00:35 +00:00
.field public static final c:Lq/g;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
.field public static final d:Lq/g$a;
2019-12-06 03:29:40 +00:00
# instance fields
.field public final a:Ljava/util/Set;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Set<",
2019-12-20 07:00:35 +00:00
"Lq/g$b;",
2019-12-06 03:29:40 +00:00
">;"
}
.end annotation
.end field
2019-12-20 07:00:35 +00:00
.field public final b:Lq/c0/i/c;
2019-12-06 03:29:40 +00:00
# direct methods
.method public static constructor <clinit>()V
.locals 3
2019-12-20 07:00:35 +00:00
new-instance v0, Lq/g$a;
2019-12-06 03:29:40 +00:00
const/4 v1, 0x0
2019-12-20 07:00:35 +00:00
invoke-direct {v0, v1}, Lq/g$a;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
sput-object v0, Lq/g;->d:Lq/g$a;
2019-12-06 03:29:40 +00:00
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
2019-12-20 07:00:35 +00:00
new-instance v2, Lq/g;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
invoke-static {v0}, Lm/q/l;->toSet(Ljava/lang/Iterable;)Ljava/util/Set;
2019-12-06 03:29:40 +00:00
move-result-object v0
2019-12-20 07:00:35 +00:00
invoke-direct {v2, v0, v1}, Lq/g;-><init>(Ljava/util/Set;Lq/c0/i/c;)V
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
sput-object v2, Lq/g;->c:Lq/g;
2019-12-06 03:29:40 +00:00
return-void
.end method
2019-12-20 07:00:35 +00:00
.method public constructor <init>(Ljava/util/Set;Lq/c0/i/c;)V
2019-12-06 03:29:40 +00:00
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/Set<",
2019-12-20 07:00:35 +00:00
"Lq/g$b;",
2019-12-06 03:29:40 +00:00
">;",
2019-12-20 07:00:35 +00:00
"Lq/c0/i/c;",
2019-12-06 03:29:40 +00:00
")V"
}
.end annotation
if-eqz p1, :cond_0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
2019-12-20 07:00:35 +00:00
iput-object p1, p0, Lq/g;->a:Ljava/util/Set;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
iput-object p2, p0, Lq/g;->b:Lq/c0/i/c;
2019-12-06 03:29:40 +00:00
return-void
:cond_0
const-string p1, "pins"
2019-12-20 07:00:35 +00:00
invoke-static {p1}, Lm/u/b/j;->a(Ljava/lang/String;)V
2019-12-06 03:29:40 +00:00
const/4 p1, 0x0
throw p1
.end method
# virtual methods
.method public final a(Ljava/lang/String;Ljava/util/List;)V
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/String;",
"Ljava/util/List<",
"+",
"Ljava/security/cert/Certificate;",
">;)V"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljavax/net/ssl/SSLPeerUnverifiedException;
}
.end annotation
const/4 v0, 0x0
if-eqz p1, :cond_1
if-eqz p2, :cond_0
2019-12-20 07:00:35 +00:00
new-instance v0, Lq/g$c;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
invoke-direct {v0, p0, p2, p1}, Lq/g$c;-><init>(Lq/g;Ljava/util/List;Ljava/lang/String;)V
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
invoke-virtual {p0, p1, v0}, Lq/g;->a(Ljava/lang/String;Lkotlin/jvm/functions/Function0;)V
2019-12-06 03:29:40 +00:00
return-void
:cond_0
const-string p1, "peerCertificates"
2019-12-20 07:00:35 +00:00
invoke-static {p1}, Lm/u/b/j;->a(Ljava/lang/String;)V
2019-12-06 03:29:40 +00:00
throw v0
:cond_1
const-string p1, "hostname"
2019-12-20 07:00:35 +00:00
invoke-static {p1}, Lm/u/b/j;->a(Ljava/lang/String;)V
2019-12-06 03:29:40 +00:00
throw v0
.end method
.method public final a(Ljava/lang/String;Lkotlin/jvm/functions/Function0;)V
.locals 11
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/String;",
"Lkotlin/jvm/functions/Function0<",
"+",
"Ljava/util/List<",
"+",
"Ljava/security/cert/X509Certificate;",
">;>;)V"
}
.end annotation
const/4 v0, 0x0
if-eqz p1, :cond_13
if-eqz p2, :cond_12
2019-12-20 07:00:35 +00:00
sget-object v1, Lm/q/o;->d:Lm/q/o;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
iget-object v2, p0, Lq/g;->a:Ljava/util/Set;
2019-12-06 03:29:40 +00:00
invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object v2
:cond_0
:goto_0
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_6
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
2019-12-20 07:00:35 +00:00
check-cast v3, Lq/g$b;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
iget-object v4, v3, Lq/g$b;->a:Ljava/lang/String;
2019-12-06 03:29:40 +00:00
const/4 v5, 0x2
const/4 v6, 0x0
const-string v7, "*."
2019-12-20 07:00:35 +00:00
invoke-static {v4, v7, v6, v5}, Lm/a0/p;->startsWith$default(Ljava/lang/String;Ljava/lang/String;ZI)Z
2019-12-06 03:29:40 +00:00
move-result v4
if-eqz v4, :cond_1
const/16 v4, 0x2e
const/4 v5, 0x6
2019-12-20 07:00:35 +00:00
invoke-static {p1, v4, v6, v6, v5}, Lm/a0/u;->indexOf$default(Ljava/lang/CharSequence;CIZI)I
2019-12-06 03:29:40 +00:00
move-result v4
invoke-virtual {p1}, Ljava/lang/String;->length()I
move-result v5
sub-int/2addr v5, v4
add-int/lit8 v5, v5, -0x1
2019-12-20 07:00:35 +00:00
iget-object v7, v3, Lq/g$b;->b:Ljava/lang/String;
2019-12-06 03:29:40 +00:00
invoke-virtual {v7}, Ljava/lang/String;->length()I
move-result v7
if-ne v5, v7, :cond_2
2019-12-20 07:00:35 +00:00
iget-object v5, v3, Lq/g$b;->b:Ljava/lang/String;
2019-12-06 03:29:40 +00:00
add-int/lit8 v4, v4, 0x1
const/4 v7, 0x4
2019-12-20 07:00:35 +00:00
invoke-static {p1, v5, v4, v6, v7}, Lm/a0/p;->startsWith$default(Ljava/lang/String;Ljava/lang/String;IZI)Z
2019-12-06 03:29:40 +00:00
move-result v4
if-eqz v4, :cond_2
const/4 v6, 0x1
goto :goto_1
:cond_1
2019-12-20 07:00:35 +00:00
iget-object v4, v3, Lq/g$b;->b:Ljava/lang/String;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
invoke-static {p1, v4}, Lm/u/b/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
2019-12-06 03:29:40 +00:00
move-result v6
:cond_2
:goto_1
if-eqz v6, :cond_0
invoke-interface {v1}, Ljava/util/List;->isEmpty()Z
move-result v4
if-eqz v4, :cond_3
new-instance v1, Ljava/util/ArrayList;
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
:cond_3
2019-12-20 07:00:35 +00:00
instance-of v4, v1, Lm/u/b/z/a;
2019-12-06 03:29:40 +00:00
if-eqz v4, :cond_5
2019-12-20 07:00:35 +00:00
instance-of v4, v1, Lm/u/b/z/d;
2019-12-06 03:29:40 +00:00
if-eqz v4, :cond_4
goto :goto_2
:cond_4
const-string p1, "kotlin.collections.MutableList"
2019-12-20 07:00:35 +00:00
invoke-static {v1, p1}, Lm/u/b/y;->throwCce(Ljava/lang/Object;Ljava/lang/String;)V
2019-12-06 03:29:40 +00:00
throw v0
:cond_5
:goto_2
invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_0
:cond_6
invoke-interface {v1}, Ljava/util/List;->isEmpty()Z
move-result v2
if-eqz v2, :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 v2
:cond_8
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_e
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/security/cert/X509Certificate;
invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v4
move-object v5, v0
move-object v6, v5
:cond_9
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
move-result v7
if-eqz v7, :cond_8
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v7
2019-12-20 07:00:35 +00:00
check-cast v7, Lq/g$b;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
iget-object v8, v7, Lq/g$b;->c:Ljava/lang/String;
2019-12-06 03:29:40 +00:00
invoke-virtual {v8}, Ljava/lang/String;->hashCode()I
move-result v9
const v10, 0x68547ca
if-eq v9, v10, :cond_b
const v10, 0x7a530ee8
if-ne v9, v10, :cond_d
const-string v9, "sha256/"
invoke-virtual {v8, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v8
if-eqz v8, :cond_d
if-nez v6, :cond_a
2019-12-20 07:00:35 +00:00
sget-object v6, Lq/g;->d:Lq/g$a;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
invoke-virtual {v6, v3}, Lq/g$a;->b(Ljava/security/cert/X509Certificate;)Lokio/ByteString;
2019-12-06 03:29:40 +00:00
move-result-object v6
:cond_a
2019-12-20 07:00:35 +00:00
iget-object v7, v7, Lq/g$b;->d:Lokio/ByteString;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
invoke-static {v7, v6}, Lm/u/b/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
2019-12-06 03:29:40 +00:00
move-result v7
if-eqz v7, :cond_9
return-void
:cond_b
const-string v9, "sha1/"
invoke-virtual {v8, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v8
if-eqz v8, :cond_d
if-nez v5, :cond_c
2019-12-20 07:00:35 +00:00
sget-object v5, Lq/g;->d:Lq/g$a;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
invoke-virtual {v5, v3}, Lq/g$a;->a(Ljava/security/cert/X509Certificate;)Lokio/ByteString;
2019-12-06 03:29:40 +00:00
move-result-object v5
:cond_c
2019-12-20 07:00:35 +00:00
iget-object v7, v7, Lq/g$b;->d:Lokio/ByteString;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
invoke-static {v7, v5}, Lm/u/b/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
2019-12-06 03:29:40 +00:00
move-result v7
if-eqz v7, :cond_9
return-void
:cond_d
new-instance p1, Ljava/lang/AssertionError;
const-string p2, "unsupported hashAlgorithm: "
invoke-static {p2}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p2
2019-12-20 07:00:35 +00:00
iget-object v0, v7, Lq/g$b;->c:Ljava/lang/String;
2019-12-06 03:29:40 +00:00
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-direct {p1, p2}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
throw p1
:cond_e
const-string v0, "Certificate pinning failure!"
const-string v2, "\n Peer certificate chain:"
invoke-static {v0, v2}, Le/e/b/a/a;->b(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 v2
const-string v3, "\n "
if-eqz v2, :cond_10
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Ljava/security/cert/X509Certificate;
if-eqz v2, :cond_f
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
2019-12-20 07:00:35 +00:00
sget-object v3, Lq/g;->d:Lq/g$a;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
invoke-virtual {v3, v2}, Lq/g$a;->a(Ljava/security/cert/Certificate;)Ljava/lang/String;
2019-12-06 03:29:40 +00:00
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 {v2}, Ljava/security/cert/X509Certificate;->getSubjectDN()Ljava/security/Principal;
move-result-object v2
const-string v3, "x509Certificate.subjectDN"
2019-12-20 07:00:35 +00:00
invoke-static {v2, v3}, Lm/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
2019-12-06 03:29:40 +00:00
invoke-interface {v2}, Ljava/security/Principal;->getName()Ljava/lang/String;
move-result-object v2
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
goto :goto_3
:cond_f
2019-12-20 07:00:35 +00:00
new-instance p1, Lm/l;
2019-12-06 03:29:40 +00:00
const-string p2, "null cannot be cast to non-null type java.security.cert.X509Certificate"
2019-12-20 07:00:35 +00:00
invoke-direct {p1, p2}, Lm/l;-><init>(Ljava/lang/String;)V
2019-12-06 03:29:40 +00:00
throw p1
:cond_10
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 {v1}, 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_11
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object p2
2019-12-20 07:00:35 +00:00
check-cast p2, Lq/g$b;
2019-12-06 03:29:40 +00:00
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_11
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
const-string p2, "StringBuilder().apply(builderAction).toString()"
2019-12-20 07:00:35 +00:00
invoke-static {p1, p2}, Lm/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
2019-12-06 03:29:40 +00:00
new-instance p2, Ljavax/net/ssl/SSLPeerUnverifiedException;
invoke-direct {p2, p1}, Ljavax/net/ssl/SSLPeerUnverifiedException;-><init>(Ljava/lang/String;)V
throw p2
:cond_12
const-string p1, "cleanedPeerCertificatesFn"
2019-12-20 07:00:35 +00:00
invoke-static {p1}, Lm/u/b/j;->a(Ljava/lang/String;)V
2019-12-06 03:29:40 +00:00
throw v0
:cond_13
const-string p1, "hostname"
2019-12-20 07:00:35 +00:00
invoke-static {p1}, Lm/u/b/j;->a(Ljava/lang/String;)V
2019-12-06 03:29:40 +00:00
throw v0
.end method
.method public equals(Ljava/lang/Object;)Z
.locals 2
2019-12-20 07:00:35 +00:00
instance-of v0, p1, Lq/g;
2019-12-06 03:29:40 +00:00
if-eqz v0, :cond_0
2019-12-20 07:00:35 +00:00
check-cast p1, Lq/g;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
iget-object v0, p1, Lq/g;->a:Ljava/util/Set;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
iget-object v1, p0, Lq/g;->a:Ljava/util/Set;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
invoke-static {v0, v1}, Lm/u/b/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
2019-12-06 03:29:40 +00:00
move-result v0
if-eqz v0, :cond_0
2019-12-20 07:00:35 +00:00
iget-object p1, p1, Lq/g;->b:Lq/c0/i/c;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
iget-object v0, p0, Lq/g;->b:Lq/c0/i/c;
2019-12-06 03:29:40 +00:00
2019-12-20 07:00:35 +00:00
invoke-static {p1, v0}, Lm/u/b/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
2019-12-06 03:29:40 +00:00
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
2019-12-20 07:00:35 +00:00
iget-object v0, p0, Lq/g;->a:Ljava/util/Set;
2019-12-06 03:29:40 +00:00
invoke-virtual {v0}, Ljava/lang/Object;->hashCode()I
move-result v0
add-int/lit16 v0, v0, 0x5ed
mul-int/lit8 v0, v0, 0x29
2019-12-20 07:00:35 +00:00
iget-object v1, p0, Lq/g;->b:Lq/c0/i/c;
2019-12-06 03:29:40 +00:00
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