168 lines
4 KiB
Smali
168 lines
4 KiB
Smali
.class public final Lcom/discord/utilities/time/ClockFactory;
|
|
.super Ljava/lang/Object;
|
|
.source "ClockFactory.kt"
|
|
|
|
|
|
# static fields
|
|
.field public static final INSTANCE:Lcom/discord/utilities/time/ClockFactory;
|
|
|
|
.field public static ntpClock:Lcom/discord/utilities/time/NtpClock;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/discord/utilities/time/ClockFactory;
|
|
|
|
invoke-direct {v0}, Lcom/discord/utilities/time/ClockFactory;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/utilities/time/ClockFactory;->INSTANCE:Lcom/discord/utilities/time/ClockFactory;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final get()Lcom/discord/utilities/time/Clock;
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/discord/utilities/time/ClockFactory;->ntpClock:Lcom/discord/utilities/time/NtpClock;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
const-string v0, "ntpClock"
|
|
|
|
invoke-static {v0}, Lj0/n/c/h;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final init(Landroid/app/Application;)V
|
|
.locals 13
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
const/4 v5, 0x0
|
|
|
|
sget-object v1, Lf/k/a/b;->e:Lf/k/a/b;
|
|
|
|
sget-object v6, Lf/k/a/b;->a:Ljava/util/List;
|
|
|
|
sget-object v1, Lf/k/a/b;->e:Lf/k/a/b;
|
|
|
|
sget-wide v7, Lf/k/a/b;->d:J
|
|
|
|
sget-object v1, Lf/k/a/b;->e:Lf/k/a/b;
|
|
|
|
sget-wide v9, Lf/k/a/b;->c:J
|
|
|
|
sget-object v1, Lf/k/a/b;->e:Lf/k/a/b;
|
|
|
|
sget-wide v11, Lf/k/a/b;->b:J
|
|
|
|
if-eqz v6, :cond_1
|
|
|
|
new-instance v0, Lf/k/a/f/a;
|
|
|
|
invoke-direct {v0}, Lf/k/a/f/a;-><init>()V
|
|
|
|
new-instance v1, Lf/k/a/f/c;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const-string v3, "com.lyft.kronos.shared_preferences"
|
|
|
|
invoke-virtual {p1, v3, v2}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v2, "context.getSharedPrefere\u2026ME, Context.MODE_PRIVATE)"
|
|
|
|
invoke-static {p1, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {v1, p1}, Lf/k/a/f/c;-><init>(Landroid/content/SharedPreferences;)V
|
|
|
|
instance-of p1, v0, Lcom/lyft/kronos/KronosClock;
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
new-instance v2, Lf/k/a/f/d/e;
|
|
|
|
new-instance p1, Lf/k/a/f/d/d;
|
|
|
|
invoke-direct {p1}, Lf/k/a/f/d/d;-><init>()V
|
|
|
|
new-instance v3, Lf/k/a/f/d/b;
|
|
|
|
invoke-direct {v3}, Lf/k/a/f/d/b;-><init>()V
|
|
|
|
invoke-direct {v2, v0, p1, v3}, Lf/k/a/f/d/e;-><init>(Lf/k/a/a;Lf/k/a/f/d/c;Lf/k/a/f/d/a;)V
|
|
|
|
new-instance v4, Lf/k/a/f/d/g;
|
|
|
|
invoke-direct {v4, v1, v0}, Lf/k/a/f/d/g;-><init>(Lf/k/a/e;Lf/k/a/a;)V
|
|
|
|
new-instance p1, Lf/k/a/f/d/i;
|
|
|
|
move-object v1, p1
|
|
|
|
move-object v3, v0
|
|
|
|
invoke-direct/range {v1 .. v12}, Lf/k/a/f/d/i;-><init>(Lf/k/a/f/d/e;Lf/k/a/a;Lf/k/a/f/d/f;Lf/k/a/d;Ljava/util/List;JJJ)V
|
|
|
|
new-instance v1, Lf/k/a/f/b;
|
|
|
|
invoke-direct {v1, p1, v0}, Lf/k/a/f/b;-><init>(Lf/k/a/f/d/h;Lf/k/a/a;)V
|
|
|
|
iget-object p1, v1, Lf/k/a/f/b;->a:Lf/k/a/f/d/h;
|
|
|
|
invoke-interface {p1}, Lf/k/a/f/d/h;->b()V
|
|
|
|
new-instance p1, Lcom/discord/utilities/time/NtpClock;
|
|
|
|
invoke-direct {p1, v1}, Lcom/discord/utilities/time/NtpClock;-><init>(Lcom/lyft/kronos/KronosClock;)V
|
|
|
|
sput-object p1, Lcom/discord/utilities/time/ClockFactory;->ntpClock:Lcom/discord/utilities/time/NtpClock;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "Local clock should implement Clock instead of KronosClock"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_1
|
|
const-string p1, "ntpHosts"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
const-string p1, "application"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|