apkfuckery/com.discord/smali_classes2/z/a/o.smali
2020-04-17 21:35:49 +02:00

573 lines
11 KiB
Smali

.class public final Lz/a/o;
.super Lz/a/u0;
.source "CommonPool.kt"
# static fields
.field public static final d:I
.field public static e:Z
.field public static final f:Lz/a/o;
.field public static volatile pool:Ljava/util/concurrent/Executor;
# direct methods
.method public static constructor <clinit>()V
.locals 4
new-instance v0, Lz/a/o;
invoke-direct {v0}, Lz/a/o;-><init>()V
sput-object v0, Lz/a/o;->f:Lz/a/o;
:try_start_0
const-string v0, "kotlinx.coroutines.default.parallelism"
invoke-static {v0}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
goto :goto_0
:catchall_0
const/4 v0, 0x0
:goto_0
if-eqz v0, :cond_1
invoke-static {v0}, Ly/a0/o;->toIntOrNull(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v1
if-eqz v1, :cond_0
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
move-result v2
const/4 v3, 0x1
if-lt v2, v3, :cond_0
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
move-result v0
goto :goto_1
:cond_0
const-string v1, "Expected positive number in kotlinx.coroutines.default.parallelism, but has "
invoke-static {v1, v0}, Lf/e/b/a/a;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
new-instance v1, Ljava/lang/IllegalStateException;
invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {v1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v1
:cond_1
const/4 v0, -0x1
:goto_1
sput v0, Lz/a/o;->d:I
return-void
.end method
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Lz/a/u0;-><init>()V
return-void
.end method
# virtual methods
.method public a(Lkotlin/coroutines/CoroutineContext;Ljava/lang/Runnable;)V
.locals 1
const/4 v0, 0x0
if-eqz p1, :cond_2
if-eqz p2, :cond_1
:try_start_0
sget-object p1, Lz/a/o;->pool:Ljava/util/concurrent/Executor;
if-eqz p1, :cond_0
goto :goto_0
:cond_0
invoke-virtual {p0}, Lz/a/o;->g()Ljava/util/concurrent/Executor;
move-result-object p1
:goto_0
sget-object v0, Lz/a/w1;->a:Lz/a/v1;
:try_end_0
.catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_0 .. :try_end_0} :catch_0
check-cast v0, Lz/a/h0;
:try_start_1
invoke-virtual {v0, p2}, Lz/a/h0;->a(Ljava/lang/Runnable;)Ljava/lang/Runnable;
invoke-interface {p1, p2}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
:try_end_1
.catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_1 .. :try_end_1} :catch_0
goto :goto_1
:catch_0
sget-object p1, Lz/a/w1;->a:Lz/a/v1;
check-cast p1, Lz/a/h0;
invoke-virtual {p1}, Lz/a/h0;->d()V
sget-object p1, Lz/a/f0;->j:Lz/a/f0;
invoke-virtual {p1, p2}, Lz/a/s0;->a(Ljava/lang/Runnable;)V
:goto_1
return-void
:cond_1
const-string p1, "block"
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
throw v0
:cond_2
const-string p1, "context"
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
throw v0
.end method
.method public final a(Ljava/lang/Class;Ljava/util/concurrent/ExecutorService;)Z
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/Class<",
"*>;",
"Ljava/util/concurrent/ExecutorService;",
")Z"
}
.end annotation
const/4 v0, 0x0
if-eqz p1, :cond_4
if-eqz p2, :cond_3
sget-object v1, Lz/a/o$b;->d:Lz/a/o$b;
invoke-interface {p2, v1}, Ljava/util/concurrent/ExecutorService;->submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;
const/4 v1, 0x0
:try_start_0
const-string v2, "getPoolSize"
new-array v3, v1, [Ljava/lang/Class;
invoke-virtual {p1, v2, v3}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object p1
new-array v2, v1, [Ljava/lang/Object;
invoke-virtual {p1, p2, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
instance-of p2, p1, Ljava/lang/Integer;
if-nez p2, :cond_0
move-object p1, v0
:cond_0
check-cast p1, Ljava/lang/Integer;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
goto :goto_0
:catchall_0
move-object p1, v0
:goto_0
if-eqz p1, :cond_2
invoke-virtual {p1}, Ljava/lang/Integer;->intValue()I
move-result p1
const/4 p2, 0x1
if-lt p1, p2, :cond_1
goto :goto_1
:cond_1
const/4 p2, 0x0
:goto_1
return p2
:cond_2
return v1
:cond_3
const-string p1, "executor"
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
throw v0
:cond_4
const-string p1, "fjpClass"
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
throw v0
.end method
.method public close()V
.locals 2
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Close cannot be invoked on CommonPool"
invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public final e()Ljava/util/concurrent/ExecutorService;
.locals 3
new-instance v0, Ljava/util/concurrent/atomic/AtomicInteger;
invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>()V
invoke-virtual {p0}, Lz/a/o;->h()I
move-result v1
new-instance v2, Lz/a/o$a;
invoke-direct {v2, v0}, Lz/a/o$a;-><init>(Ljava/util/concurrent/atomic/AtomicInteger;)V
invoke-static {v1, v2}, Ljava/util/concurrent/Executors;->newFixedThreadPool(ILjava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ExecutorService;
move-result-object v0
const-string v1, "Executors.newFixedThread\u2026Daemon = true }\n }"
invoke-static {v0, v1}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
return-object v0
.end method
.method public final f()Ljava/util/concurrent/ExecutorService;
.locals 6
invoke-static {}, Ljava/lang/System;->getSecurityManager()Ljava/lang/SecurityManager;
move-result-object v0
if-eqz v0, :cond_0
invoke-virtual {p0}, Lz/a/o;->e()Ljava/util/concurrent/ExecutorService;
move-result-object v0
return-object v0
:cond_0
const-string v0, "java.util.concurrent.ForkJoinPool"
const/4 v1, 0x0
:try_start_0
invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
move-result-object v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
goto :goto_0
:catchall_0
move-object v0, v1
:goto_0
if-eqz v0, :cond_7
sget-boolean v2, Lz/a/o;->e:Z
const/4 v3, 0x0
if-nez v2, :cond_4
sget v2, Lz/a/o;->d:I
if-gez v2, :cond_4
:try_start_1
const-string v2, "commonPool"
new-array v4, v3, [Ljava/lang/Class;
invoke-virtual {v0, v2, v4}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
move-result-object v2
if-eqz v2, :cond_1
new-array v4, v3, [Ljava/lang/Object;
invoke-virtual {v2, v1, v4}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v2
goto :goto_1
:cond_1
move-object v2, v1
:goto_1
instance-of v4, v2, Ljava/util/concurrent/ExecutorService;
if-nez v4, :cond_2
move-object v2, v1
:cond_2
check-cast v2, Ljava/util/concurrent/ExecutorService;
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
goto :goto_2
:catchall_1
move-object v2, v1
:goto_2
if-eqz v2, :cond_4
sget-object v4, Lz/a/o;->f:Lz/a/o;
invoke-virtual {v4, v0, v2}, Lz/a/o;->a(Ljava/lang/Class;Ljava/util/concurrent/ExecutorService;)Z
move-result v4
if-eqz v4, :cond_3
goto :goto_3
:cond_3
move-object v2, v1
:goto_3
if-eqz v2, :cond_4
return-object v2
:cond_4
const/4 v2, 0x1
:try_start_2
new-array v4, v2, [Ljava/lang/Class;
sget-object v5, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;
aput-object v5, v4, v3
invoke-virtual {v0, v4}, Ljava/lang/Class;->getConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
move-result-object v0
new-array v2, v2, [Ljava/lang/Object;
sget-object v4, Lz/a/o;->f:Lz/a/o;
invoke-virtual {v4}, Lz/a/o;->h()I
move-result v4
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v4
aput-object v4, v2, v3
invoke-virtual {v0, v2}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
instance-of v2, v0, Ljava/util/concurrent/ExecutorService;
if-nez v2, :cond_5
move-object v0, v1
:cond_5
check-cast v0, Ljava/util/concurrent/ExecutorService;
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_2
goto :goto_4
:catchall_2
move-object v0, v1
:goto_4
if-eqz v0, :cond_6
return-object v0
:cond_6
invoke-virtual {p0}, Lz/a/o;->e()Ljava/util/concurrent/ExecutorService;
move-result-object v0
return-object v0
:cond_7
invoke-virtual {p0}, Lz/a/o;->e()Ljava/util/concurrent/ExecutorService;
move-result-object v0
return-object v0
.end method
.method public final declared-synchronized g()Ljava/util/concurrent/Executor;
.locals 1
monitor-enter p0
:try_start_0
sget-object v0, Lz/a/o;->pool:Ljava/util/concurrent/Executor;
if-eqz v0, :cond_0
goto :goto_0
:cond_0
invoke-virtual {p0}, Lz/a/o;->f()Ljava/util/concurrent/ExecutorService;
move-result-object v0
sput-object v0, Lz/a/o;->pool:Ljava/util/concurrent/Executor;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:goto_0
monitor-exit p0
return-object v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final h()I
.locals 3
sget v0, Lz/a/o;->d:I
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Number;->intValue()I
move-result v1
const/4 v2, 0x1
if-lez v1, :cond_0
const/4 v1, 0x1
goto :goto_0
:cond_0
const/4 v1, 0x0
:goto_0
if-eqz v1, :cond_1
goto :goto_1
:cond_1
const/4 v0, 0x0
:goto_1
if-eqz v0, :cond_2
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
move-result v0
goto :goto_2
:cond_2
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Runtime;->availableProcessors()I
move-result v0
sub-int/2addr v0, v2
if-ge v0, v2, :cond_3
const/4 v0, 0x1
:cond_3
:goto_2
return v0
.end method
.method public toString()Ljava/lang/String;
.locals 1
const-string v0, "CommonPool"
return-object v0
.end method