apkfuckery/com.discord/smali/e/c/a/k1.smali

650 lines
15 KiB
Smali
Raw Normal View History

2019-12-06 03:29:40 +00:00
.class public Le/c/a/k1;
.super Ljava/lang/Object;
.source "PackageHandler.java"
# interfaces
.implements Le/c/a/v0;
# instance fields
.field public a:Le/c/a/p0;
.field public b:Le/c/a/w0;
.field public c:Ljava/lang/ref/WeakReference;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/ref/WeakReference<",
"Le/c/a/s0;",
">;"
}
.end annotation
.end field
.field public d:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Le/c/a/s;",
">;"
}
.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:Le/c/a/u0;
.field public i:Le/c/a/n0;
# direct methods
.method public constructor <init>(Le/c/a/s0;Landroid/content/Context;Z)V
.locals 3
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Le/c/a/p0;
const-string v1, "PackageHandler"
const/4 v2, 0x0
invoke-direct {v0, v1, v2}, Le/c/a/p0;-><init>(Ljava/lang/String;Z)V
iput-object v0, p0, Le/c/a/k1;->a:Le/c/a/p0;
invoke-static {}, Le/c/a/z;->a()Le/c/a/u0;
move-result-object v0
iput-object v0, p0, Le/c/a/k1;->h:Le/c/a/u0;
sget-object v0, Le/c/a/z;->i:Le/c/a/n0;
if-nez v0, :cond_0
sget-object v0, Le/c/a/n0;->d:Le/c/a/n0;
:cond_0
iput-object v0, p0, Le/c/a/k1;->i:Le/c/a/n0;
new-instance v0, Ljava/lang/ref/WeakReference;
invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V
iput-object v0, p0, Le/c/a/k1;->c:Ljava/lang/ref/WeakReference;
iput-object p2, p0, Le/c/a/k1;->g:Landroid/content/Context;
xor-int/lit8 p1, p3, 0x1
iput-boolean p1, p0, Le/c/a/k1;->f:Z
iget-object p1, p0, Le/c/a/k1;->a:Le/c/a/p0;
new-instance p2, Le/c/a/k1$a;
invoke-direct {p2, p0}, Le/c/a/k1$a;-><init>(Le/c/a/k1;)V
iget-object p1, p1, Le/c/a/p0;->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
# virtual methods
.method public final a()V
.locals 6
sget-object v0, Le/c/a/z;->b:Le/c/a/w0;
if-nez v0, :cond_0
new-instance v0, Le/c/a/n1;
invoke-direct {v0, p0}, Le/c/a/n1;-><init>(Le/c/a/v0;)V
goto :goto_0
:cond_0
check-cast v0, Le/c/a/n1;
invoke-virtual {v0, p0}, Le/c/a/n1;->a(Le/c/a/v0;)V
sget-object v0, Le/c/a/z;->b:Le/c/a/w0;
:goto_0
iput-object v0, p0, Le/c/a/k1;->b:Le/c/a/w0;
new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;
invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>()V
iput-object v0, p0, Le/c/a/k1;->e:Ljava/util/concurrent/atomic/AtomicBoolean;
const-string v0, "Package queue"
const/4 v1, 0x1
const/4 v2, 0x0
:try_start_0
iget-object v3, p0, Le/c/a/k1;->g:Landroid/content/Context;
const-string v4, "AdjustIoPackageQueue"
const-class v5, Ljava/util/List;
invoke-static {v3, v4, v0, v5}, Le/c/a/a2;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/util/List;
iput-object v3, p0, Le/c/a/k1;->d:Ljava/util/List;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_1
:catch_0
move-exception v3
iget-object v4, p0, Le/c/a/k1;->h:Le/c/a/u0;
const/4 v5, 0x2
new-array v5, v5, [Ljava/lang/Object;
aput-object v0, v5, v2
invoke-virtual {v3}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
move-result-object v0
aput-object v0, v5, v1
check-cast v4, Le/c/a/b1;
const-string v0, "Failed to read %s file (%s)"
invoke-virtual {v4, v0, v5}, Le/c/a/b1;->b(Ljava/lang/String;[Ljava/lang/Object;)V
const/4 v0, 0x0
iput-object v0, p0, Le/c/a/k1;->d:Ljava/util/List;
:goto_1
iget-object v0, p0, Le/c/a/k1;->d:Ljava/util/List;
if-eqz v0, :cond_1
iget-object v3, p0, Le/c/a/k1;->h:Le/c/a/u0;
new-array v1, v1, [Ljava/lang/Object;
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v0
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v0
aput-object v0, v1, v2
check-cast v3, Le/c/a/b1;
const-string v0, "Package handler read %d packages"
invoke-virtual {v3, v0, v1}, Le/c/a/b1;->a(Ljava/lang/String;[Ljava/lang/Object;)V
goto :goto_2
:cond_1
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
iput-object v0, p0, Le/c/a/k1;->d:Ljava/util/List;
:goto_2
return-void
.end method
.method public a(Le/c/a/o1;)V
.locals 2
iget-object v0, p0, Le/c/a/k1;->a:Le/c/a/p0;
new-instance v1, Le/c/a/k1$c;
invoke-direct {v1, p0}, Le/c/a/k1$c;-><init>(Le/c/a/k1;)V
iget-object v0, v0, Le/c/a/p0;->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, Le/c/a/k1;->c:Ljava/lang/ref/WeakReference;
invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;
move-result-object v0
check-cast v0, Le/c/a/s0;
if-eqz v0, :cond_0
check-cast v0, Le/c/a/g;
invoke-virtual {v0, p1}, Le/c/a/g;->a(Le/c/a/o1;)V
:cond_0
return-void
.end method
.method public a(Le/c/a/o1;Le/c/a/s;)V
.locals 7
const/4 v0, 0x1
iput-boolean v0, p1, Le/c/a/o1;->e:Z
iget-object v1, p0, Le/c/a/k1;->c:Ljava/lang/ref/WeakReference;
invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;
move-result-object v1
check-cast v1, Le/c/a/s0;
if-eqz v1, :cond_0
check-cast v1, Le/c/a/g;
invoke-virtual {v1, p1}, Le/c/a/g;->a(Le/c/a/o1;)V
:cond_0
new-instance p1, Le/c/a/k1$d;
invoke-direct {p1, p0}, Le/c/a/k1$d;-><init>(Le/c/a/k1;)V
if-nez p2, :cond_1
invoke-interface {p1}, Ljava/lang/Runnable;->run()V
return-void
:cond_1
invoke-virtual {p2}, Le/c/a/s;->n()I
move-result p2
iget-object v1, p0, Le/c/a/k1;->i:Le/c/a/n0;
invoke-static {p2, v1}, Le/c/a/a2;->a(ILe/c/a/n0;)J
move-result-wide v1
long-to-double v3, v1
const-wide v5, 0x408f400000000000L # 1000.0
div-double/2addr v3, v5
sget-object v5, Le/c/a/a2;->a:Ljava/text/DecimalFormat;
invoke-virtual {v5, v3, v4}, Ljava/text/DecimalFormat;->format(D)Ljava/lang/String;
move-result-object v3
iget-object v4, p0, Le/c/a/k1;->h:Le/c/a/u0;
const/4 v5, 0x2
new-array v5, v5, [Ljava/lang/Object;
const/4 v6, 0x0
aput-object v3, v5, v6
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p2
aput-object p2, v5, v0
check-cast v4, Le/c/a/b1;
const-string p2, "Waiting for %s seconds before retrying the %d time"
invoke-virtual {v4, p2, v5}, Le/c/a/b1;->d(Ljava/lang/String;[Ljava/lang/Object;)V
iget-object p2, p0, Le/c/a/k1;->a:Le/c/a/p0;
sget-object v0, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
iget-object p2, p2, Le/c/a/p0;->a:Ljava/util/concurrent/ScheduledThreadPoolExecutor;
invoke-virtual {p2, p1, v1, v2, v0}, Ljava/util/concurrent/ScheduledThreadPoolExecutor;->schedule(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
return-void
.end method
.method public a(Le/c/a/u1;)V
.locals 3
if-eqz p1, :cond_1
new-instance v0, Le/c/a/u1;
invoke-direct {v0}, Le/c/a/u1;-><init>()V
iget-object v1, p1, Le/c/a/u1;->a:Ljava/util/Map;
if-eqz v1, :cond_0
new-instance v2, Ljava/util/HashMap;
invoke-direct {v2, v1}, Ljava/util/HashMap;-><init>(Ljava/util/Map;)V
iput-object v2, v0, Le/c/a/u1;->a:Ljava/util/Map;
:cond_0
iget-object p1, p1, Le/c/a/u1;->b:Ljava/util/Map;
if-eqz p1, :cond_2
new-instance v1, Ljava/util/HashMap;
invoke-direct {v1, p1}, Ljava/util/HashMap;-><init>(Ljava/util/Map;)V
iput-object v1, v0, Le/c/a/u1;->b:Ljava/util/Map;
goto :goto_0
:cond_1
const/4 v0, 0x0
:cond_2
:goto_0
iget-object p1, p0, Le/c/a/k1;->a:Le/c/a/p0;
new-instance v1, Le/c/a/k1$e;
invoke-direct {v1, p0, v0}, Le/c/a/k1$e;-><init>(Le/c/a/k1;Le/c/a/u1;)V
iget-object p1, p1, Le/c/a/p0;->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 final b()V
.locals 5
iget-object v0, p0, Le/c/a/k1;->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, Le/c/a/k1;->f:Z
const/4 v1, 0x0
if-eqz v0, :cond_1
iget-object v0, p0, Le/c/a/k1;->h:Le/c/a/u0;
new-array v1, v1, [Ljava/lang/Object;
check-cast v0, Le/c/a/b1;
const-string v2, "Package handler is paused"
invoke-virtual {v0, v2, v1}, Le/c/a/b1;->a(Ljava/lang/String;[Ljava/lang/Object;)V
return-void
:cond_1
iget-object v0, p0, Le/c/a/k1;->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, Le/c/a/k1;->h:Le/c/a/u0;
new-array v1, v1, [Ljava/lang/Object;
check-cast v0, Le/c/a/b1;
const-string v2, "Package handler is already sending"
invoke-virtual {v0, v2, v1}, Le/c/a/b1;->d(Ljava/lang/String;[Ljava/lang/Object;)V
return-void
:cond_2
iget-object v0, p0, Le/c/a/k1;->d:Ljava/util/List;
invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Le/c/a/s;
iget-object v1, p0, Le/c/a/k1;->b:Le/c/a/w0;
iget-object v3, p0, Le/c/a/k1;->d:Ljava/util/List;
invoke-interface {v3}, Ljava/util/List;->size()I
move-result v3
sub-int/2addr v3, v2
check-cast v1, Le/c/a/n1;
iget-object v2, v1, Le/c/a/n1;->a:Le/c/a/p0;
new-instance v4, Le/c/a/m1;
invoke-direct {v4, v1, v0, v3}, Le/c/a/m1;-><init>(Le/c/a/n1;Le/c/a/s;I)V
iget-object v0, v2, Le/c/a/p0;->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 b(Le/c/a/u1;)V
.locals 6
if-nez p1, :cond_0
return-void
:cond_0
iget-object v0, p0, Le/c/a/k1;->h:Le/c/a/u0;
const/4 v1, 0x0
new-array v2, v1, [Ljava/lang/Object;
check-cast v0, Le/c/a/b1;
const-string v3, "Updating package handler queue"
invoke-virtual {v0, v3, v2}, Le/c/a/b1;->a(Ljava/lang/String;[Ljava/lang/Object;)V
iget-object v0, p0, Le/c/a/k1;->h:Le/c/a/u0;
const/4 v2, 0x1
new-array v3, v2, [Ljava/lang/Object;
iget-object v4, p1, Le/c/a/u1;->a:Ljava/util/Map;
aput-object v4, v3, v1
check-cast v0, Le/c/a/b1;
const-string v4, "Session callback parameters: %s"
invoke-virtual {v0, v4, v3}, Le/c/a/b1;->d(Ljava/lang/String;[Ljava/lang/Object;)V
iget-object v0, p0, Le/c/a/k1;->h:Le/c/a/u0;
new-array v2, v2, [Ljava/lang/Object;
iget-object v3, p1, Le/c/a/u1;->b:Ljava/util/Map;
aput-object v3, v2, v1
check-cast v0, Le/c/a/b1;
const-string v1, "Session partner parameters: %s"
invoke-virtual {v0, v1, v2}, Le/c/a/b1;->d(Ljava/lang/String;[Ljava/lang/Object;)V
iget-object v0, p0, Le/c/a/k1;->d:Ljava/util/List;
invoke-interface {v0}, Ljava/util/List;->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_1
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Le/c/a/s;
invoke-virtual {v1}, Le/c/a/s;->i()Ljava/util/Map;
move-result-object v2
iget-object v3, p1, Le/c/a/u1;->a:Ljava/util/Map;
invoke-virtual {v1}, Le/c/a/s;->b()Ljava/util/Map;
move-result-object v4
const-string v5, "Callback"
invoke-static {v3, v4, v5}, Le/c/a/a2;->a(Ljava/util/Map;Ljava/util/Map;Ljava/lang/String;)Ljava/util/Map;
move-result-object v3
const-string v4, "callback_params"
invoke-static {v2, v4, v3}, Le/c/a/j1;->a(Ljava/util/Map;Ljava/lang/String;Ljava/util/Map;)V
iget-object v3, p1, Le/c/a/u1;->b:Ljava/util/Map;
invoke-virtual {v1}, Le/c/a/s;->j()Ljava/util/Map;
move-result-object v1
const-string v4, "Partner"
invoke-static {v3, v1, v4}, Le/c/a/a2;->a(Ljava/util/Map;Ljava/util/Map;Ljava/lang/String;)Ljava/util/Map;
move-result-object v1
const-string v3, "partner_params"
invoke-static {v2, v3, v1}, Le/c/a/j1;->a(Ljava/util/Map;Ljava/lang/String;Ljava/util/Map;)V
goto :goto_0
:cond_1
invoke-virtual {p0}, Le/c/a/k1;->d()V
return-void
.end method
.method public c()V
.locals 2
iget-object v0, p0, Le/c/a/k1;->a:Le/c/a/p0;
new-instance v1, Le/c/a/k1$b;
invoke-direct {v1, p0}, Le/c/a/k1$b;-><init>(Le/c/a/k1;)V
iget-object v0, v0, Le/c/a/p0;->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 final d()V
.locals 4
iget-object v0, p0, Le/c/a/k1;->d:Ljava/util/List;
iget-object v1, p0, Le/c/a/k1;->g:Landroid/content/Context;
const-string v2, "AdjustIoPackageQueue"
const-string v3, "Package queue"
invoke-static {v0, v1, v2, v3}, Le/c/a/a2;->a(Ljava/lang/Object;Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V
iget-object v0, p0, Le/c/a/k1;->h:Le/c/a/u0;
const/4 v1, 0x1
new-array v1, v1, [Ljava/lang/Object;
iget-object v2, p0, Le/c/a/k1;->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, Le/c/a/b1;
const-string v2, "Package handler wrote %d packages"
invoke-virtual {v0, v2, v1}, Le/c/a/b1;->a(Ljava/lang/String;[Ljava/lang/Object;)V
return-void
.end method