487 lines
12 KiB
Smali
487 lines
12 KiB
Smali
.class public final Lcom/discord/utilities/persister/Persister$Companion;
|
|
.super Ljava/lang/Object;
|
|
.source "Persister.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/utilities/persister/Persister;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "Companion"
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/utilities/persister/Persister$Companion;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$availableBytes(Lcom/discord/utilities/persister/Persister$Companion;)J
|
|
.locals 2
|
|
|
|
invoke-direct {p0}, Lcom/discord/utilities/persister/Persister$Companion;->availableBytes()J
|
|
|
|
move-result-wide v0
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$persistAll(Lcom/discord/utilities/persister/Persister$Companion;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/utilities/persister/Persister$Companion;->persistAll()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final availableBytes()J
|
|
.locals 3
|
|
|
|
invoke-static {}, Lcom/discord/utilities/persister/Persister;->access$getContext$cp()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
const-string v2, "activity"
|
|
|
|
invoke-virtual {v0, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v2, v0, Landroid/app/ActivityManager;
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move-object v1, v0
|
|
|
|
:goto_0
|
|
check-cast v1, Landroid/app/ActivityManager;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
new-instance v0, Landroid/app/ActivityManager$MemoryInfo;
|
|
|
|
invoke-direct {v0}, Landroid/app/ActivityManager$MemoryInfo;-><init>()V
|
|
|
|
invoke-virtual {v1, v0}, Landroid/app/ActivityManager;->getMemoryInfo(Landroid/app/ActivityManager$MemoryInfo;)V
|
|
|
|
iget-wide v0, v0, Landroid/app/ActivityManager$MemoryInfo;->availMem:J
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const-wide v0, 0x7fffffffffffffffL
|
|
|
|
:goto_1
|
|
return-wide v0
|
|
|
|
:cond_2
|
|
const-string v0, "context"
|
|
|
|
invoke-static {v0}, Lj0/o/c/h;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method private final persistAll()V
|
|
.locals 10
|
|
|
|
invoke-static {}, Lcom/discord/utilities/persister/Persister;->access$getPreferences$cp()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->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, Ljava/lang/ref/WeakReference;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
new-instance v2, Lr0/l/e/j;
|
|
|
|
invoke-direct {v2, v1}, Lr0/l/e/j;-><init>(Ljava/lang/Object;)V
|
|
|
|
const-string v1, "Observable\n .just(weakPreference.get())"
|
|
|
|
invoke-static {v2, v1}, Lj0/o/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationBuffered(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v6, Lcom/discord/utilities/persister/Persister$Companion$persistAll$1$1;->INSTANCE:Lcom/discord/utilities/persister/Persister$Companion$persistAll$1$1;
|
|
|
|
const-class v4, Lcom/discord/utilities/persister/Persister;
|
|
|
|
const/16 v2, 0x3c
|
|
|
|
and-int/lit8 v3, v2, 0x4
|
|
|
|
and-int/lit8 v3, v2, 0x8
|
|
|
|
and-int/lit8 v3, v2, 0x10
|
|
|
|
and-int/lit8 v2, v2, 0x20
|
|
|
|
const/4 v8, 0x0
|
|
|
|
if-eqz v6, :cond_0
|
|
|
|
new-instance v9, Lf/a/b/c0;
|
|
|
|
move-object v2, v9
|
|
|
|
move-object v3, v8
|
|
|
|
move-object v5, v8
|
|
|
|
move-object v7, v8
|
|
|
|
invoke-direct/range {v2 .. v8}, Lf/a/b/c0;-><init>(Landroid/content/Context;Ljava/lang/Class;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lrx/functions/Action1;Lkotlin/jvm/functions/Function0;)V
|
|
|
|
invoke-virtual {v1, v9}, Lrx/Observable;->k(Lrx/Observable$c;)Lrx/Observable;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const-string v0, "onNext"
|
|
|
|
invoke-static {v0}, Lj0/o/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v8
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getKryoConfig()Lkotlin/jvm/functions/Function1;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
"Lcom/esotericsoftware/kryo/Kryo;",
|
|
"Lkotlin/Unit;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-static {}, Lcom/discord/utilities/persister/Persister;->access$getKryoConfig$cp()Lkotlin/jvm/functions/Function1;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getLogger()Lkotlin/jvm/functions/Function3;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lkotlin/jvm/functions/Function3<",
|
|
"Ljava/lang/Integer;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/Exception;",
|
|
"Lkotlin/Unit;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-static {}, Lcom/discord/utilities/persister/Persister;->access$getLogger$cp()Lkotlin/jvm/functions/Function3;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final init(Landroid/content/Context;Lcom/discord/utilities/time/Clock;Lrx/Observable;)V
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/content/Context;",
|
|
"Lcom/discord/utilities/time/Clock;",
|
|
"Lrx/Observable<",
|
|
"Ljava/lang/Boolean;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v6, 0x0
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
if-eqz p3, :cond_2
|
|
|
|
invoke-static {}, Lcom/discord/utilities/persister/Persister;->access$getInitialized$cp()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
invoke-static {v0}, Lcom/discord/utilities/persister/Persister;->access$setInitialized$cp(Z)V
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/persister/Persister;->access$setContext$cp(Landroid/content/Context;)V
|
|
|
|
invoke-static {p2}, Lcom/discord/utilities/persister/Persister;->access$setClock$cp(Lcom/discord/utilities/time/Clock;)V
|
|
|
|
new-instance p1, Lcom/discord/utilities/persister/Persister$Preloader;
|
|
|
|
invoke-direct {p1, p2}, Lcom/discord/utilities/persister/Persister$Preloader;-><init>(Lcom/discord/utilities/time/Clock;)V
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/persister/Persister;->access$setPreferencesPreloader$cp(Lcom/discord/utilities/persister/Persister$Preloader;)V
|
|
|
|
sget-object p1, Lcom/discord/utilities/persister/Persister$Companion$init$1;->INSTANCE:Lcom/discord/utilities/persister/Persister$Companion$init$1;
|
|
|
|
invoke-virtual {p3, p1}, Lrx/Observable;->v(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "persistenceStrategy\n \u2026er { persist -> persist }"
|
|
|
|
invoke-static {p1, p2}, Lj0/o/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationBuffered(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object v4, Lcom/discord/utilities/persister/Persister$Companion$init$2;->INSTANCE:Lcom/discord/utilities/persister/Persister$Companion$init$2;
|
|
|
|
const-class v2, Lcom/discord/utilities/persister/Persister;
|
|
|
|
const/16 p2, 0x3c
|
|
|
|
and-int/lit8 p3, p2, 0x4
|
|
|
|
and-int/lit8 p3, p2, 0x8
|
|
|
|
and-int/lit8 p3, p2, 0x10
|
|
|
|
and-int/lit8 p2, p2, 0x20
|
|
|
|
if-eqz v4, :cond_1
|
|
|
|
new-instance p2, Lf/a/b/c0;
|
|
|
|
move-object v0, p2
|
|
|
|
move-object v1, v6
|
|
|
|
move-object v3, v6
|
|
|
|
move-object v5, v6
|
|
|
|
invoke-direct/range {v0 .. v6}, Lf/a/b/c0;-><init>(Landroid/content/Context;Ljava/lang/Class;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lrx/functions/Action1;Lkotlin/jvm/functions/Function0;)V
|
|
|
|
invoke-virtual {p1, p2}, Lrx/Observable;->k(Lrx/Observable$c;)Lrx/Observable;
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string p1, "onNext"
|
|
|
|
invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v6
|
|
|
|
:cond_2
|
|
const-string p1, "persistenceStrategy"
|
|
|
|
invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v6
|
|
|
|
:cond_3
|
|
const-string p1, "clock"
|
|
|
|
invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v6
|
|
|
|
:cond_4
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v6
|
|
.end method
|
|
|
|
.method public final isPreloaded()Lrx/Observable;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Ljava/lang/Boolean;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-static {}, Lcom/discord/utilities/persister/Persister;->access$getPreferencesPreloader$cp()Lcom/discord/utilities/persister/Persister$Preloader;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/persister/Persister$Preloader;->isPreloaded$app_productionDiscordExternalRelease()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
const-string v0, "preferencesPreloader"
|
|
|
|
invoke-static {v0}, Lj0/o/c/h;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final reset()V
|
|
.locals 2
|
|
|
|
invoke-static {}, Lcom/discord/utilities/persister/Persister;->access$getPreferences$cp()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_0
|
|
: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, Ljava/lang/ref/WeakReference;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/discord/utilities/persister/Persister;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/persister/Persister;->clear()Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public final setKryoConfig(Lkotlin/jvm/functions/Function1;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
"-",
|
|
"Lcom/esotericsoftware/kryo/Kryo;",
|
|
"Lkotlin/Unit;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/persister/Persister;->access$setKryoConfig$cp(Lkotlin/jvm/functions/Function1;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "<set-?>"
|
|
|
|
invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final setLogger(Lkotlin/jvm/functions/Function3;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lkotlin/jvm/functions/Function3<",
|
|
"-",
|
|
"Ljava/lang/Integer;",
|
|
"-",
|
|
"Ljava/lang/String;",
|
|
"-",
|
|
"Ljava/lang/Exception;",
|
|
"Lkotlin/Unit;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/persister/Persister;->access$setLogger$cp(Lkotlin/jvm/functions/Function3;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "<set-?>"
|
|
|
|
invoke-static {p1}, Lj0/o/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|