apkfuckery/com.discord/smali_classes2/c0/o.smali

784 lines
16 KiB
Smali
Raw Normal View History

2020-04-17 19:35:49 +00:00
.class public final Lc0/o;
.super Ljava/lang/Object;
.source "Dispatcher.kt"
# instance fields
.field public a:I
.field public b:I
.field public c:Ljava/lang/Runnable;
.field public d:Ljava/util/concurrent/ExecutorService;
.field public final e:Ljava/util/ArrayDeque;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayDeque<",
"Lc0/x$a;",
">;"
}
.end annotation
.end field
.field public final f:Ljava/util/ArrayDeque;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayDeque<",
"Lc0/x$a;",
">;"
}
.end annotation
.end field
.field public final g:Ljava/util/ArrayDeque;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayDeque<",
"Lc0/x;",
">;"
}
.end annotation
.end field
# direct methods
.method public constructor <init>()V
.locals 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/16 v0, 0x40
iput v0, p0, Lc0/o;->a:I
const/4 v0, 0x5
iput v0, p0, Lc0/o;->b:I
new-instance v0, Ljava/util/ArrayDeque;
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
iput-object v0, p0, Lc0/o;->e:Ljava/util/ArrayDeque;
new-instance v0, Ljava/util/ArrayDeque;
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
iput-object v0, p0, Lc0/o;->f:Ljava/util/ArrayDeque;
new-instance v0, Ljava/util/ArrayDeque;
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
iput-object v0, p0, Lc0/o;->g:Ljava/util/ArrayDeque;
return-void
.end method
# virtual methods
.method public final declared-synchronized a()V
.locals 2
monitor-enter p0
:try_start_0
iget-object v0, p0, Lc0/o;->e:Ljava/util/ArrayDeque;
invoke-virtual {v0}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator;
move-result-object v0
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_0
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lc0/x$a;
iget-object v1, v1, Lc0/x$a;->f:Lc0/x;
invoke-virtual {v1}, Lc0/x;->a()V
goto :goto_0
:cond_0
iget-object v0, p0, Lc0/o;->f:Ljava/util/ArrayDeque;
invoke-virtual {v0}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator;
move-result-object v0
:goto_1
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_1
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lc0/x$a;
iget-object v1, v1, Lc0/x$a;->f:Lc0/x;
invoke-virtual {v1}, Lc0/x;->a()V
goto :goto_1
:cond_1
iget-object v0, p0, Lc0/o;->g:Ljava/util/ArrayDeque;
invoke-virtual {v0}, Ljava/util/ArrayDeque;->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_2
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lc0/x;
invoke-virtual {v1}, Lc0/x;->a()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
goto :goto_2
:cond_2
monitor-exit p0
return-void
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final a(Lc0/x$a;)V
.locals 5
const/4 v0, 0x0
if-eqz p1, :cond_5
monitor-enter p0
:try_start_0
iget-object v1, p0, Lc0/o;->e:Ljava/util/ArrayDeque;
invoke-virtual {v1, p1}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z
iget-object v1, p1, Lc0/x$a;->f:Lc0/x;
iget-boolean v1, v1, Lc0/x;->h:Z
if-nez v1, :cond_4
invoke-virtual {p1}, Lc0/x$a;->a()Ljava/lang/String;
move-result-object v1
iget-object v2, p0, Lc0/o;->f:Ljava/util/ArrayDeque;
invoke-virtual {v2}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator;
move-result-object v2
:cond_0
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_1
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
check-cast v3, Lc0/x$a;
invoke-virtual {v3}, Lc0/x$a;->a()Ljava/lang/String;
move-result-object v4
invoke-static {v4, v1}, Ly/u/b/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_0
goto :goto_0
:cond_1
iget-object v2, p0, Lc0/o;->e:Ljava/util/ArrayDeque;
invoke-virtual {v2}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator;
move-result-object v2
:cond_2
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_3
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
check-cast v3, Lc0/x$a;
invoke-virtual {v3}, Lc0/x$a;->a()Ljava/lang/String;
move-result-object v4
invoke-static {v4, v1}, Ly/u/b/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_2
goto :goto_0
:cond_3
move-object v3, v0
:goto_0
if-eqz v3, :cond_4
iget-object v0, v3, Lc0/x$a;->d:Ljava/util/concurrent/atomic/AtomicInteger;
iput-object v0, p1, Lc0/x$a;->d:Ljava/util/concurrent/atomic/AtomicInteger;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:cond_4
monitor-exit p0
invoke-virtual {p0}, Lc0/o;->c()Z
return-void
:catchall_0
move-exception p1
monitor-exit p0
throw p1
:cond_5
const-string p1, "call"
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
throw v0
.end method
.method public final declared-synchronized a(Lc0/x;)V
.locals 1
monitor-enter p0
:try_start_0
const-string v0, "call"
if-eqz p1, :cond_0
iget-object v0, p0, Lc0/o;->g:Ljava/util/ArrayDeque;
invoke-virtual {v0, p1}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return-void
:cond_0
:try_start_1
invoke-static {v0}, Ly/u/b/j;->a(Ljava/lang/String;)V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
const/4 p1, 0x0
throw p1
:catchall_0
move-exception p1
monitor-exit p0
throw p1
.end method
.method public final a(Ljava/util/Deque;Ljava/lang/Object;)V
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(",
"Ljava/util/Deque<",
"TT;>;TT;)V"
}
.end annotation
monitor-enter p0
:try_start_0
invoke-interface {p1, p2}, Ljava/util/Deque;->remove(Ljava/lang/Object;)Z
move-result p1
if-eqz p1, :cond_1
iget-object p1, p0, Lc0/o;->c:Ljava/lang/Runnable;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
invoke-virtual {p0}, Lc0/o;->c()Z
move-result p2
if-nez p2, :cond_0
if-eqz p1, :cond_0
invoke-interface {p1}, Ljava/lang/Runnable;->run()V
:cond_0
return-void
:cond_1
:try_start_1
new-instance p1, Ljava/lang/AssertionError;
const-string p2, "Call wasn\'t in-flight!"
invoke-direct {p1, p2}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
throw p1
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
:catchall_0
move-exception p1
monitor-exit p0
throw p1
.end method
.method public final declared-synchronized b()Ljava/util/concurrent/ExecutorService;
.locals 9
monitor-enter p0
:try_start_0
iget-object v0, p0, Lc0/o;->d:Ljava/util/concurrent/ExecutorService;
if-nez v0, :cond_0
new-instance v0, Ljava/util/concurrent/ThreadPoolExecutor;
const/4 v2, 0x0
const v3, 0x7fffffff
const-wide/16 v4, 0x3c
sget-object v6, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
new-instance v7, Ljava/util/concurrent/SynchronousQueue;
invoke-direct {v7}, Ljava/util/concurrent/SynchronousQueue;-><init>()V
const-string v1, "OkHttp Dispatcher"
const/4 v8, 0x0
invoke-static {v1, v8}, Lc0/c0/a;->a(Ljava/lang/String;Z)Ljava/util/concurrent/ThreadFactory;
move-result-object v8
move-object v1, v0
invoke-direct/range {v1 .. v8}, Ljava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V
iput-object v0, p0, Lc0/o;->d:Ljava/util/concurrent/ExecutorService;
:cond_0
iget-object v0, p0, Lc0/o;->d:Ljava/util/concurrent/ExecutorService;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz v0, :cond_1
monitor-exit p0
return-object v0
:cond_1
:try_start_1
invoke-static {}, Ly/u/b/j;->throwNpe()V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
const/4 v0, 0x0
throw v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final b(Lc0/x$a;)V
.locals 1
if-eqz p1, :cond_0
iget-object v0, p1, Lc0/x$a;->d:Ljava/util/concurrent/atomic/AtomicInteger;
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;->decrementAndGet()I
iget-object v0, p0, Lc0/o;->f:Ljava/util/ArrayDeque;
invoke-virtual {p0, v0, p1}, Lc0/o;->a(Ljava/util/Deque;Ljava/lang/Object;)V
return-void
:cond_0
const-string p1, "call"
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
const/4 p1, 0x0
throw p1
.end method
.method public final c()Z
.locals 9
invoke-static {p0}, Ljava/lang/Thread;->holdsLock(Ljava/lang/Object;)Z
move-result v0
const/4 v1, 0x1
xor-int/2addr v0, v1
sget-boolean v2, Ly/p;->a:Z
if-eqz v2, :cond_1
if-eqz v0, :cond_0
goto :goto_0
:cond_0
new-instance v0, Ljava/lang/AssertionError;
const-string v1, "Assertion failed"
invoke-direct {v0, v1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
throw v0
:cond_1
:goto_0
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
monitor-enter p0
:try_start_0
iget-object v2, p0, Lc0/o;->e:Ljava/util/ArrayDeque;
invoke-virtual {v2}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator;
move-result-object v2
const-string v3, "readyAsyncCalls.iterator()"
invoke-static {v2, v3}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
:goto_1
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_4
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
check-cast v3, Lc0/x$a;
iget-object v4, p0, Lc0/o;->f:Ljava/util/ArrayDeque;
invoke-virtual {v4}, Ljava/util/ArrayDeque;->size()I
move-result v4
iget v5, p0, Lc0/o;->a:I
if-lt v4, v5, :cond_2
goto :goto_2
:cond_2
iget-object v4, v3, Lc0/x$a;->d:Ljava/util/concurrent/atomic/AtomicInteger;
invoke-virtual {v4}, Ljava/util/concurrent/atomic/AtomicInteger;->get()I
move-result v4
iget v5, p0, Lc0/o;->b:I
if-lt v4, v5, :cond_3
goto :goto_1
:cond_3
invoke-interface {v2}, Ljava/util/Iterator;->remove()V
iget-object v4, v3, Lc0/x$a;->d:Ljava/util/concurrent/atomic/AtomicInteger;
invoke-virtual {v4}, Ljava/util/concurrent/atomic/AtomicInteger;->incrementAndGet()I
const-string v4, "asyncCall"
invoke-static {v3, v4}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-interface {v0, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
iget-object v4, p0, Lc0/o;->f:Ljava/util/ArrayDeque;
invoke-virtual {v4, v3}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z
goto :goto_1
:cond_4
:goto_2
invoke-virtual {p0}, Lc0/o;->d()I
move-result v2
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_1
const/4 v3, 0x0
if-lez v2, :cond_5
const/4 v2, 0x1
goto :goto_3
:cond_5
const/4 v2, 0x0
:goto_3
monitor-exit p0
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v4
:goto_4
if-ge v3, v4, :cond_9
invoke-interface {v0, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v5
check-cast v5, Lc0/x$a;
invoke-virtual {p0}, Lc0/o;->b()Ljava/util/concurrent/ExecutorService;
move-result-object v6
if-eqz v6, :cond_8
iget-object v7, v5, Lc0/x$a;->f:Lc0/x;
iget-object v7, v7, Lc0/x;->f:Lc0/v;
iget-object v7, v7, Lc0/v;->d:Lc0/o;
invoke-static {v7}, Ljava/lang/Thread;->holdsLock(Ljava/lang/Object;)Z
move-result v7
xor-int/2addr v7, v1
sget-boolean v8, Ly/p;->a:Z
if-eqz v8, :cond_7
if-eqz v7, :cond_6
goto :goto_5
:cond_6
new-instance v0, Ljava/lang/AssertionError;
const-string v1, "Assertion failed"
invoke-direct {v0, v1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
throw v0
:cond_7
:goto_5
:try_start_1
invoke-interface {v6, v5}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
:try_end_1
.catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_1 .. :try_end_1} :catch_0
.catchall {:try_start_1 .. :try_end_1} :catchall_0
goto :goto_6
:catchall_0
move-exception v0
goto :goto_7
:catch_0
move-exception v6
:try_start_2
new-instance v7, Ljava/io/InterruptedIOException;
const-string v8, "executor rejected"
invoke-direct {v7, v8}, Ljava/io/InterruptedIOException;-><init>(Ljava/lang/String;)V
invoke-virtual {v7, v6}, Ljava/io/InterruptedIOException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;
iget-object v6, v5, Lc0/x$a;->f:Lc0/x;
invoke-static {v6}, Lc0/x;->a(Lc0/x;)Lc0/c0/c/n;
move-result-object v6
invoke-virtual {v6, v7}, Lc0/c0/c/n;->a(Ljava/io/IOException;)Ljava/io/IOException;
iget-object v6, v5, Lc0/x$a;->e:Lc0/f;
iget-object v8, v5, Lc0/x$a;->f:Lc0/x;
invoke-interface {v6, v8, v7}, Lc0/f;->a(Lc0/e;Ljava/io/IOException;)V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
iget-object v6, v5, Lc0/x$a;->f:Lc0/x;
iget-object v6, v6, Lc0/x;->f:Lc0/v;
iget-object v6, v6, Lc0/v;->d:Lc0/o;
invoke-virtual {v6, v5}, Lc0/o;->b(Lc0/x$a;)V
:goto_6
add-int/lit8 v3, v3, 0x1
goto :goto_4
:goto_7
iget-object v1, v5, Lc0/x$a;->f:Lc0/x;
iget-object v1, v1, Lc0/x;->f:Lc0/v;
iget-object v1, v1, Lc0/v;->d:Lc0/o;
invoke-virtual {v1, v5}, Lc0/o;->b(Lc0/x$a;)V
throw v0
:cond_8
const-string v0, "executorService"
invoke-static {v0}, Ly/u/b/j;->a(Ljava/lang/String;)V
const/4 v0, 0x0
throw v0
:cond_9
return v2
:catchall_1
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final declared-synchronized d()I
.locals 2
monitor-enter p0
:try_start_0
iget-object v0, p0, Lc0/o;->f:Ljava/util/ArrayDeque;
invoke-virtual {v0}, Ljava/util/ArrayDeque;->size()I
move-result v0
iget-object v1, p0, Lc0/o;->g:Ljava/util/ArrayDeque;
invoke-virtual {v1}, Ljava/util/ArrayDeque;->size()I
move-result v1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
add-int/2addr v0, v1
monitor-exit p0
return v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method