apkfuckery/com.discord/smali_classes2/okhttp3/internal/publicsuffix/PublicSuffixDatabase.smali
2019-12-06 04:29:40 +01:00

805 lines
18 KiB
Smali

.class public final Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;
.super Ljava/lang/Object;
.source "PublicSuffixDatabase.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lokhttp3/internal/publicsuffix/PublicSuffixDatabase$a;
}
.end annotation
# static fields
.field public static final e:[B
.field public static final f:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Ljava/lang/String;",
">;"
}
.end annotation
.end field
.field public static final g:Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;
.field public static final h:Lokhttp3/internal/publicsuffix/PublicSuffixDatabase$a;
# instance fields
.field public final a:Ljava/util/concurrent/atomic/AtomicBoolean;
.field public final b:Ljava/util/concurrent/CountDownLatch;
.field public c:[B
.field public d:[B
# direct methods
.method public static constructor <clinit>()V
.locals 3
new-instance v0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase$a;
const/4 v1, 0x0
invoke-direct {v0, v1}, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase$a;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
sput-object v0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->h:Lokhttp3/internal/publicsuffix/PublicSuffixDatabase$a;
const/4 v0, 0x1
new-array v0, v0, [B
const/16 v1, 0x2a
int-to-byte v1, v1
const/4 v2, 0x0
aput-byte v1, v0, v2
sput-object v0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->e:[B
const-string v0, "*"
invoke-static {v0}, Le/k/a/b/e/p/g;->listOf(Ljava/lang/Object;)Ljava/util/List;
move-result-object v0
sput-object v0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->f:Ljava/util/List;
new-instance v0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;
invoke-direct {v0}, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;-><init>()V
sput-object v0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->g:Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;
return-void
.end method
.method public constructor <init>()V
.locals 2
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;
const/4 v1, 0x0
invoke-direct {v0, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>(Z)V
iput-object v0, p0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->a:Ljava/util/concurrent/atomic/AtomicBoolean;
new-instance v0, Ljava/util/concurrent/CountDownLatch;
const/4 v1, 0x1
invoke-direct {v0, v1}, Ljava/util/concurrent/CountDownLatch;-><init>(I)V
iput-object v0, p0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->b:Ljava/util/concurrent/CountDownLatch;
return-void
.end method
# virtual methods
.method public final a(Ljava/lang/String;)Ljava/lang/String;
.locals 10
const/4 v0, 0x0
if-eqz p1, :cond_2
invoke-static {p1}, Ljava/net/IDN;->toUnicode(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
const-string v2, "unicodeDomain"
invoke-static {v1, v2}, Ls/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const/4 v2, 0x1
new-array v3, v2, [C
const/16 v4, 0x2e
const/4 v5, 0x0
aput-char v4, v3, v5
const/4 v6, 0x6
invoke-static {v1, v3, v5, v5, v6}, Ls/a0/u;->split$default(Ljava/lang/CharSequence;[CZII)Ljava/util/List;
move-result-object v1
invoke-virtual {p0, v1}, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->a(Ljava/util/List;)Ljava/util/List;
move-result-object v3
invoke-interface {v1}, Ljava/util/List;->size()I
move-result v7
invoke-interface {v3}, Ljava/util/List;->size()I
move-result v8
const/16 v9, 0x21
if-ne v7, v8, :cond_0
invoke-interface {v3, v5}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v7
check-cast v7, Ljava/lang/String;
invoke-virtual {v7, v5}, Ljava/lang/String;->charAt(I)C
move-result v7
if-eq v7, v9, :cond_0
return-object v0
:cond_0
invoke-interface {v3, v5}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
invoke-virtual {v0, v5}, Ljava/lang/String;->charAt(I)C
move-result v0
if-ne v0, v9, :cond_1
invoke-interface {v1}, Ljava/util/List;->size()I
move-result v0
invoke-interface {v3}, Ljava/util/List;->size()I
move-result v1
goto :goto_0
:cond_1
invoke-interface {v1}, Ljava/util/List;->size()I
move-result v0
invoke-interface {v3}, Ljava/util/List;->size()I
move-result v1
add-int/2addr v1, v2
:goto_0
sub-int/2addr v0, v1
new-array v1, v2, [C
aput-char v4, v1, v5
invoke-static {p1, v1, v5, v5, v6}, Ls/a0/u;->split$default(Ljava/lang/CharSequence;[CZII)Ljava/util/List;
move-result-object p1
invoke-static {p1}, Ls/q/l;->asSequence(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
move-result-object p1
invoke-static {p1, v0}, Le/k/a/b/e/p/g;->drop(Lkotlin/sequences/Sequence;I)Lkotlin/sequences/Sequence;
move-result-object v1
const/4 v3, 0x0
const/4 v4, 0x0
const/4 v5, 0x0
const/4 v6, 0x0
const/4 v7, 0x0
const/16 v8, 0x3e
const-string v2, "."
invoke-static/range {v1 .. v8}, Le/k/a/b/e/p/g;->joinToString$default(Lkotlin/sequences/Sequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;I)Ljava/lang/String;
move-result-object p1
return-object p1
:cond_2
const-string p1, "domain"
invoke-static {p1}, Ls/u/b/j;->a(Ljava/lang/String;)V
throw v0
.end method
.method public final a(Ljava/util/List;)Ljava/util/List;
.locals 10
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Ljava/lang/String;",
">;)",
"Ljava/util/List<",
"Ljava/lang/String;",
">;"
}
.end annotation
iget-object v0, p0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->a:Ljava/util/concurrent/atomic/AtomicBoolean;
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z
move-result v0
const/4 v1, 0x1
const/4 v2, 0x0
if-nez v0, :cond_1
iget-object v0, p0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->a:Ljava/util/concurrent/atomic/AtomicBoolean;
invoke-virtual {v0, v2, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;->compareAndSet(ZZ)Z
move-result v0
if-eqz v0, :cond_1
const/4 v0, 0x0
:goto_0
:try_start_0
invoke-virtual {p0}, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->a()V
:try_end_0
.catch Ljava/io/InterruptedIOException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz v0, :cond_2
:try_start_1
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/Thread;->interrupt()V
:try_end_1
.catch Ljava/io/InterruptedIOException; {:try_start_1 .. :try_end_1} :catch_1
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
goto :goto_2
:catchall_0
move-exception p1
goto :goto_1
:catch_0
move-exception v3
:try_start_2
sget-object v4, Lv/c0/g/f;->c:Lv/c0/g/f$a;
invoke-virtual {v4}, Lv/c0/g/f$a;->b()Lv/c0/g/f;
move-result-object v4
const/4 v5, 0x5
const-string v6, "Failed to read public suffix list"
invoke-virtual {v4, v5, v6, v3}, Lv/c0/g/f;->a(ILjava/lang/String;Ljava/lang/Throwable;)V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
if-eqz v0, :cond_2
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Thread;->interrupt()V
goto :goto_2
:catch_1
:try_start_3
invoke-static {}, Ljava/lang/Thread;->interrupted()Z
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
const/4 v0, 0x1
goto :goto_0
:goto_1
if-eqz v0, :cond_0
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Thread;->interrupt()V
:cond_0
throw p1
:cond_1
:try_start_4
iget-object v0, p0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->b:Ljava/util/concurrent/CountDownLatch;
invoke-virtual {v0}, Ljava/util/concurrent/CountDownLatch;->await()V
:try_end_4
.catch Ljava/lang/InterruptedException; {:try_start_4 .. :try_end_4} :catch_2
goto :goto_2
:catch_2
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Thread;->interrupt()V
:cond_2
:goto_2
iget-object v0, p0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->c:[B
if-eqz v0, :cond_3
const/4 v0, 0x1
goto :goto_3
:cond_3
const/4 v0, 0x0
:goto_3
if-eqz v0, :cond_14
invoke-interface {p1}, Ljava/util/List;->size()I
move-result v0
new-array v3, v0, [[B
const/4 v4, 0x0
:goto_4
if-ge v4, v0, :cond_5
invoke-interface {p1, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v5
check-cast v5, Ljava/lang/String;
sget-object v6, Ljava/nio/charset/StandardCharsets;->UTF_8:Ljava/nio/charset/Charset;
const-string v7, "UTF_8"
invoke-static {v6, v7}, Ls/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
if-eqz v5, :cond_4
invoke-virtual {v5, v6}, Ljava/lang/String;->getBytes(Ljava/nio/charset/Charset;)[B
move-result-object v5
const-string v6, "(this as java.lang.String).getBytes(charset)"
invoke-static {v5, v6}, Ls/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
aput-object v5, v3, v4
add-int/lit8 v4, v4, 0x1
goto :goto_4
:cond_4
new-instance p1, Ls/l;
const-string v0, "null cannot be cast to non-null type java.lang.String"
invoke-direct {p1, v0}, Ls/l;-><init>(Ljava/lang/String;)V
throw p1
:cond_5
array-length p1, v3
const/4 v0, 0x0
:goto_5
const-string v4, "publicSuffixListBytes"
const/4 v5, 0x0
if-ge v0, p1, :cond_8
sget-object v6, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->h:Lokhttp3/internal/publicsuffix/PublicSuffixDatabase$a;
iget-object v7, p0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->c:[B
if-eqz v7, :cond_7
invoke-virtual {v6, v7, v3, v0}, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase$a;->a([B[[BI)Ljava/lang/String;
move-result-object v6
if-eqz v6, :cond_6
goto :goto_6
:cond_6
add-int/lit8 v0, v0, 0x1
goto :goto_5
:cond_7
invoke-static {v4}, Ls/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
throw v5
:cond_8
move-object v6, v5
:goto_6
array-length p1, v3
if-le p1, v1, :cond_b
invoke-virtual {v3}, Ljava/lang/Object;->clone()Ljava/lang/Object;
move-result-object p1
check-cast p1, [[B
array-length v0, p1
sub-int/2addr v0, v1
const/4 v7, 0x0
:goto_7
if-ge v7, v0, :cond_b
sget-object v8, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->e:[B
aput-object v8, p1, v7
sget-object v8, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->h:Lokhttp3/internal/publicsuffix/PublicSuffixDatabase$a;
iget-object v9, p0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->c:[B
if-eqz v9, :cond_a
invoke-virtual {v8, v9, p1, v7}, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase$a;->a([B[[BI)Ljava/lang/String;
move-result-object v8
if-eqz v8, :cond_9
goto :goto_8
:cond_9
add-int/lit8 v7, v7, 0x1
goto :goto_7
:cond_a
invoke-static {v4}, Ls/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
throw v5
:cond_b
move-object v8, v5
:goto_8
if-eqz v8, :cond_e
array-length p1, v3
sub-int/2addr p1, v1
const/4 v0, 0x0
:goto_9
if-ge v0, p1, :cond_e
sget-object v4, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->h:Lokhttp3/internal/publicsuffix/PublicSuffixDatabase$a;
iget-object v7, p0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->d:[B
if-eqz v7, :cond_d
invoke-virtual {v4, v7, v3, v0}, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase$a;->a([B[[BI)Ljava/lang/String;
move-result-object v4
if-eqz v4, :cond_c
goto :goto_a
:cond_c
add-int/lit8 v0, v0, 0x1
goto :goto_9
:cond_d
const-string p1, "publicSuffixExceptionListBytes"
invoke-static {p1}, Ls/u/b/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
throw v5
:cond_e
move-object v4, v5
:goto_a
const/4 p1, 0x6
const/16 v0, 0x2e
if-eqz v4, :cond_f
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const/16 v5, 0x21
invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
new-array v1, v1, [C
aput-char v0, v1, v2
invoke-static {v3, v1, v2, v2, p1}, Ls/a0/u;->split$default(Ljava/lang/CharSequence;[CZII)Ljava/util/List;
move-result-object p1
return-object p1
:cond_f
if-nez v6, :cond_10
if-nez v8, :cond_10
sget-object p1, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->f:Ljava/util/List;
return-object p1
:cond_10
if-eqz v6, :cond_11
new-array v3, v1, [C
aput-char v0, v3, v2
invoke-static {v6, v3, v2, v2, p1}, Ls/a0/u;->split$default(Ljava/lang/CharSequence;[CZII)Ljava/util/List;
move-result-object v3
if-eqz v3, :cond_11
goto :goto_b
:cond_11
sget-object v3, Ls/q/o;->d:Ls/q/o;
:goto_b
if-eqz v8, :cond_12
new-array v1, v1, [C
aput-char v0, v1, v2
invoke-static {v8, v1, v2, v2, p1}, Ls/a0/u;->split$default(Ljava/lang/CharSequence;[CZII)Ljava/util/List;
move-result-object p1
if-eqz p1, :cond_12
goto :goto_c
:cond_12
sget-object p1, Ls/q/o;->d:Ls/q/o;
:goto_c
invoke-interface {v3}, Ljava/util/List;->size()I
move-result v0
invoke-interface {p1}, Ljava/util/List;->size()I
move-result v1
if-le v0, v1, :cond_13
move-object p1, v3
:cond_13
return-object p1
:cond_14
new-instance p1, Ljava/lang/IllegalStateException;
const-string v0, "Unable to load publicsuffixes.gz resource from the classpath."
invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public final a()V
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const-class v0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;
const-string v1, "publicsuffixes.gz"
invoke-virtual {v0, v1}, Ljava/lang/Class;->getResourceAsStream(Ljava/lang/String;)Ljava/io/InputStream;
move-result-object v0
if-eqz v0, :cond_2
new-instance v1, Lw/k;
invoke-static {v0}, Le/k/a/b/e/p/g;->a(Ljava/io/InputStream;)Lw/w;
move-result-object v0
invoke-direct {v1, v0}, Lw/k;-><init>(Lw/w;)V
invoke-static {v1}, Le/k/a/b/e/p/g;->a(Lw/w;)Lw/g;
move-result-object v0
:try_start_0
invoke-interface {v0}, Lw/g;->readInt()I
move-result v1
int-to-long v1, v1
invoke-interface {v0, v1, v2}, Lw/g;->e(J)[B
move-result-object v1
invoke-interface {v0}, Lw/g;->readInt()I
move-result v2
int-to-long v2, v2
invoke-interface {v0, v2, v3}, Lw/g;->e(J)[B
move-result-object v2
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_1
const/4 v3, 0x0
invoke-static {v0, v3}, Le/k/a/b/e/p/g;->closeFinally(Ljava/io/Closeable;Ljava/lang/Throwable;)V
monitor-enter p0
if-eqz v1, :cond_1
:try_start_1
iput-object v1, p0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->c:[B
if-eqz v2, :cond_0
iput-object v2, p0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->d:[B
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
monitor-exit p0
iget-object v0, p0, Lokhttp3/internal/publicsuffix/PublicSuffixDatabase;->b:Ljava/util/concurrent/CountDownLatch;
invoke-virtual {v0}, Ljava/util/concurrent/CountDownLatch;->countDown()V
return-void
:cond_0
:try_start_2
invoke-static {}, Ls/u/b/j;->throwNpe()V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
throw v3
:catchall_0
move-exception v0
goto :goto_0
:cond_1
:try_start_3
invoke-static {}, Ls/u/b/j;->throwNpe()V
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
throw v3
:goto_0
monitor-exit p0
throw v0
:catchall_1
move-exception v1
:try_start_4
throw v1
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_2
:catchall_2
move-exception v2
invoke-static {v0, v1}, Le/k/a/b/e/p/g;->closeFinally(Ljava/io/Closeable;Ljava/lang/Throwable;)V
throw v2
:cond_2
return-void
.end method