apkfuckery/com.discord/smali/f/c/a/g1.smali

444 lines
10 KiB
Smali
Raw Normal View History

2020-07-08 16:44:49 +00:00
.class public Lf/c/a/g1;
2020-05-17 12:40:10 +00:00
.super Ljava/lang/Object;
2020-07-08 16:44:49 +00:00
.source "PackageHandler.java"
# interfaces
.implements Lf/c/a/r0;
# instance fields
.field public a:Lf/c/a/l0;
.field public b:Lf/c/a/s0;
.field public c:Ljava/lang/ref/WeakReference;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/ref/WeakReference<",
"Lf/c/a/o0;",
">;"
}
.end annotation
.end field
.field public d:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Lf/c/a/p;",
">;"
}
.end annotation
.end field
.field public e:Ljava/util/concurrent/atomic/AtomicBoolean;
.field public f:Z
.field public g:Landroid/content/Context;
.field public h:Lf/c/a/q0;
.field public i:Lf/c/a/j0;
# direct methods
.method public constructor <init>(Lf/c/a/o0;Landroid/content/Context;Z)V
.locals 3
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Lf/c/a/l0;
const-string v1, "PackageHandler"
const/4 v2, 0x0
invoke-direct {v0, v1, v2}, Lf/c/a/l0;-><init>(Ljava/lang/String;Z)V
iput-object v0, p0, Lf/c/a/g1;->a:Lf/c/a/l0;
invoke-static {}, Lf/c/a/v;->a()Lf/c/a/q0;
move-result-object v0
iput-object v0, p0, Lf/c/a/g1;->h:Lf/c/a/q0;
sget-object v0, Lf/c/a/j0;->d:Lf/c/a/j0;
iput-object v0, p0, Lf/c/a/g1;->i:Lf/c/a/j0;
new-instance v0, Ljava/lang/ref/WeakReference;
invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V
iput-object v0, p0, Lf/c/a/g1;->c:Ljava/lang/ref/WeakReference;
iput-object p2, p0, Lf/c/a/g1;->g:Landroid/content/Context;
xor-int/lit8 p1, p3, 0x1
iput-boolean p1, p0, Lf/c/a/g1;->f:Z
iget-object p1, p0, Lf/c/a/g1;->a:Lf/c/a/l0;
new-instance p2, Lf/c/a/g1$a;
invoke-direct {p2, p0}, Lf/c/a/g1$a;-><init>(Lf/c/a/g1;)V
iget-object p1, p1, Lf/c/a/l0;->a:Ljava/util/concurrent/ScheduledThreadPoolExecutor;
invoke-virtual {p1, p2}, Ljava/util/concurrent/ScheduledThreadPoolExecutor;->submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;
return-void
.end method
2020-05-17 12:40:10 +00:00
# virtual methods
2020-07-08 16:44:49 +00:00
.method public a()V
.locals 1
const/4 v0, 0x1
iput-boolean v0, p0, Lf/c/a/g1;->f:Z
return-void
.end method
.method public b()V
.locals 2
iget-object v0, p0, Lf/c/a/g1;->a:Lf/c/a/l0;
new-instance v1, Lf/c/a/g1$c;
invoke-direct {v1, p0}, Lf/c/a/g1$c;-><init>(Lf/c/a/g1;)V
iget-object v0, v0, Lf/c/a/l0;->a:Ljava/util/concurrent/ScheduledThreadPoolExecutor;
invoke-virtual {v0, v1}, Ljava/util/concurrent/ScheduledThreadPoolExecutor;->submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;
return-void
.end method
.method public c(Lf/c/a/j1;)V
.locals 2
iget-object v0, p0, Lf/c/a/g1;->a:Lf/c/a/l0;
new-instance v1, Lf/c/a/g1$d;
invoke-direct {v1, p0}, Lf/c/a/g1$d;-><init>(Lf/c/a/g1;)V
iget-object v0, v0, Lf/c/a/l0;->a:Ljava/util/concurrent/ScheduledThreadPoolExecutor;
invoke-virtual {v0, v1}, Ljava/util/concurrent/ScheduledThreadPoolExecutor;->submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;
iget-object v0, p0, Lf/c/a/g1;->c:Ljava/lang/ref/WeakReference;
invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lf/c/a/o0;
if-eqz v0, :cond_0
invoke-interface {v0, p1}, Lf/c/a/o0;->b(Lf/c/a/j1;)V
:cond_0
return-void
.end method
.method public d(Lf/c/a/p;)V
.locals 2
iget-object v0, p0, Lf/c/a/g1;->a:Lf/c/a/l0;
new-instance v1, Lf/c/a/g1$b;
invoke-direct {v1, p0, p1}, Lf/c/a/g1$b;-><init>(Lf/c/a/g1;Lf/c/a/p;)V
iget-object p1, v0, Lf/c/a/l0;->a:Ljava/util/concurrent/ScheduledThreadPoolExecutor;
invoke-virtual {p1, v1}, Ljava/util/concurrent/ScheduledThreadPoolExecutor;->submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;
return-void
.end method
.method public e(Lf/c/a/p1;)V
.locals 3
if-eqz p1, :cond_1
new-instance v0, Lf/c/a/p1;
invoke-direct {v0}, Lf/c/a/p1;-><init>()V
iget-object v1, p1, Lf/c/a/p1;->a:Ljava/util/Map;
if-eqz v1, :cond_0
new-instance v1, Ljava/util/HashMap;
iget-object v2, p1, Lf/c/a/p1;->a:Ljava/util/Map;
invoke-direct {v1, v2}, Ljava/util/HashMap;-><init>(Ljava/util/Map;)V
iput-object v1, v0, Lf/c/a/p1;->a:Ljava/util/Map;
:cond_0
iget-object v1, p1, Lf/c/a/p1;->b:Ljava/util/Map;
if-eqz v1, :cond_2
new-instance v1, Ljava/util/HashMap;
iget-object p1, p1, Lf/c/a/p1;->b:Ljava/util/Map;
invoke-direct {v1, p1}, Ljava/util/HashMap;-><init>(Ljava/util/Map;)V
iput-object v1, v0, Lf/c/a/p1;->b:Ljava/util/Map;
goto :goto_0
:cond_1
const/4 v0, 0x0
:cond_2
:goto_0
iget-object p1, p0, Lf/c/a/g1;->a:Lf/c/a/l0;
new-instance v1, Lf/c/a/g1$f;
invoke-direct {v1, p0, v0}, Lf/c/a/g1$f;-><init>(Lf/c/a/g1;Lf/c/a/p1;)V
iget-object p1, p1, Lf/c/a/l0;->a:Ljava/util/concurrent/ScheduledThreadPoolExecutor;
invoke-virtual {p1, v1}, Ljava/util/concurrent/ScheduledThreadPoolExecutor;->submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;
return-void
.end method
.method public f(Lf/c/a/j1;Lf/c/a/p;)V
.locals 8
const/4 v0, 0x1
iput-boolean v0, p1, Lf/c/a/j1;->e:Z
iget-object v1, p0, Lf/c/a/g1;->c:Ljava/lang/ref/WeakReference;
invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lf/c/a/o0;
if-eqz v1, :cond_0
invoke-interface {v1, p1}, Lf/c/a/o0;->b(Lf/c/a/j1;)V
:cond_0
new-instance p1, Lf/c/a/g1$e;
invoke-direct {p1, p0}, Lf/c/a/g1$e;-><init>(Lf/c/a/g1;)V
iget v1, p2, Lf/c/a/p;->retries:I
add-int/2addr v1, v0
iput v1, p2, Lf/c/a/p;->retries:I
iget-object p2, p0, Lf/c/a/g1;->i:Lf/c/a/j0;
invoke-static {v1, p2}, Lf/c/a/v1;->o(ILf/c/a/j0;)J
move-result-wide v2
long-to-double v4, v2
const-wide v6, 0x408f400000000000L # 1000.0
div-double/2addr v4, v6
sget-object p2, Lf/c/a/v1;->a:Ljava/text/DecimalFormat;
invoke-virtual {p2, v4, v5}, Ljava/text/DecimalFormat;->format(D)Ljava/lang/String;
move-result-object p2
iget-object v4, p0, Lf/c/a/g1;->h:Lf/c/a/q0;
const/4 v5, 0x2
new-array v5, v5, [Ljava/lang/Object;
const/4 v6, 0x0
aput-object p2, v5, v6
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p2
aput-object p2, v5, v0
check-cast v4, Lf/c/a/x0;
const-string p2, "Waiting for %s seconds before retrying the %d time"
invoke-virtual {v4, p2, v5}, Lf/c/a/x0;->d(Ljava/lang/String;[Ljava/lang/Object;)V
iget-object p2, p0, Lf/c/a/g1;->a:Lf/c/a/l0;
sget-object v0, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
iget-object p2, p2, Lf/c/a/l0;->a:Ljava/util/concurrent/ScheduledThreadPoolExecutor;
invoke-virtual {p2, p1, v2, v3, v0}, Ljava/util/concurrent/ScheduledThreadPoolExecutor;->schedule(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
return-void
.end method
.method public g()V
.locals 1
const/4 v0, 0x0
iput-boolean v0, p0, Lf/c/a/g1;->f:Z
return-void
.end method
.method public final h()V
.locals 5
iget-object v0, p0, Lf/c/a/g1;->d:Ljava/util/List;
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
move-result v0
if-eqz v0, :cond_0
return-void
:cond_0
iget-boolean v0, p0, Lf/c/a/g1;->f:Z
const/4 v1, 0x0
if-eqz v0, :cond_1
iget-object v0, p0, Lf/c/a/g1;->h:Lf/c/a/q0;
new-array v1, v1, [Ljava/lang/Object;
check-cast v0, Lf/c/a/x0;
const-string v2, "Package handler is paused"
invoke-virtual {v0, v2, v1}, Lf/c/a/x0;->a(Ljava/lang/String;[Ljava/lang/Object;)V
return-void
:cond_1
iget-object v0, p0, Lf/c/a/g1;->e:Ljava/util/concurrent/atomic/AtomicBoolean;
const/4 v2, 0x1
invoke-virtual {v0, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;->getAndSet(Z)Z
move-result v0
if-eqz v0, :cond_2
iget-object v0, p0, Lf/c/a/g1;->h:Lf/c/a/q0;
new-array v1, v1, [Ljava/lang/Object;
check-cast v0, Lf/c/a/x0;
const-string v2, "Package handler is already sending"
invoke-virtual {v0, v2, v1}, Lf/c/a/x0;->d(Ljava/lang/String;[Ljava/lang/Object;)V
return-void
:cond_2
iget-object v0, p0, Lf/c/a/g1;->d:Ljava/util/List;
invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lf/c/a/p;
iget-object v1, p0, Lf/c/a/g1;->b:Lf/c/a/s0;
iget-object v3, p0, Lf/c/a/g1;->d:Ljava/util/List;
invoke-interface {v3}, Ljava/util/List;->size()I
move-result v3
sub-int/2addr v3, v2
check-cast v1, Lf/c/a/i1;
iget-object v2, v1, Lf/c/a/i1;->a:Lf/c/a/l0;
new-instance v4, Lf/c/a/h1;
invoke-direct {v4, v1, v0, v3}, Lf/c/a/h1;-><init>(Lf/c/a/i1;Lf/c/a/p;I)V
iget-object v0, v2, Lf/c/a/l0;->a:Ljava/util/concurrent/ScheduledThreadPoolExecutor;
invoke-virtual {v0, v4}, Ljava/util/concurrent/ScheduledThreadPoolExecutor;->submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;
return-void
.end method
.method public final i()V
.locals 4
iget-object v0, p0, Lf/c/a/g1;->d:Ljava/util/List;
iget-object v1, p0, Lf/c/a/g1;->g:Landroid/content/Context;
const-string v2, "AdjustIoPackageQueue"
const-string v3, "Package queue"
invoke-static {v0, v1, v2, v3}, Lf/c/a/v1;->E(Ljava/lang/Object;Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
iget-object v0, p0, Lf/c/a/g1;->h:Lf/c/a/q0;
const/4 v1, 0x1
new-array v1, v1, [Ljava/lang/Object;
iget-object v2, p0, Lf/c/a/g1;->d:Ljava/util/List;
invoke-interface {v2}, Ljava/util/List;->size()I
move-result v2
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
const/4 v3, 0x0
aput-object v2, v1, v3
check-cast v0, Lf/c/a/x0;
const-string v2, "Package handler wrote %d packages"
invoke-virtual {v0, v2, v1}, Lf/c/a/x0;->a(Ljava/lang/String;[Ljava/lang/Object;)V
return-void
2020-05-17 12:40:10 +00:00
.end method