.class public final Lcom/floydwiz/gamingcenter/utils/network/AnalyticsHelper;
.super Ljava/lang/Object;
.source ""


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/floydwiz/gamingcenter/utils/network/AnalyticsHelper$a;
    }
.end annotation


# static fields
.field public static final INSTANCE:Lcom/floydwiz/gamingcenter/utils/network/AnalyticsHelper;


# direct methods
.method public static constructor <clinit>()V
    .registers 1

    new-instance v0, Lcom/floydwiz/gamingcenter/utils/network/AnalyticsHelper;

    invoke-direct {v0}, Lcom/floydwiz/gamingcenter/utils/network/AnalyticsHelper;-><init>()V

    sput-object v0, Lcom/floydwiz/gamingcenter/utils/network/AnalyticsHelper;->INSTANCE:Lcom/floydwiz/gamingcenter/utils/network/AnalyticsHelper;

    return-void
.end method

.method private constructor <init>()V
    .registers 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public final initializeAmplitude(Landroid/app/Application;)V
    .registers 12

    const-string v0, "appContext"

    invoke-static {p1, v0}, Lx/e;->f(Ljava/lang/Object;Ljava/lang/String;)V

    invoke-static {}, Lg3/a;->a()Lg3/e;

    move-result-object v0

    const-string v5, "61f34b80eec9aab6c61d432802f2ddef"

    .line 1
    monitor-enter v0

    :try_start_c
    invoke-static {v5}, Lg3/t;->c(Ljava/lang/String;)Z

    move-result v1

    const/4 v8, 0x0

    if-eqz v1, :cond_1b

    const-string v1, "com.amplitude.api.AmplitudeClient"

    const-string v2, "Argument apiKey cannot be null or blank in initialize()"

    .line 2
    invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_45

    .line 3
    :cond_1b
    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    iput-object v1, v0, Lg3/e;->a:Landroid/content/Context;

    iput-object v5, v0, Lg3/e;->d:Ljava/lang/String;

    iget-object v2, v0, Lg3/e;->e:Ljava/lang/String;

    invoke-static {v1, v2}, Lg3/n;->o(Landroid/content/Context;Ljava/lang/String;)Lg3/n;

    move-result-object v1

    iput-object v1, v0, Lg3/e;->c:Lg3/n;

    invoke-static {v8}, Lg3/t;->c(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_34

    const-string v1, "Android"

    goto :goto_35

    :cond_34
    move-object v1, v8

    :goto_35
    iput-object v1, v0, Lg3/e;->k:Ljava/lang/String;

    new-instance v9, Lg3/c;

    const/4 v4, 0x0

    const/4 v6, 0x0

    move-object v1, v9

    move-object v2, v0

    move-object v3, p1

    move-object v7, v0

    invoke-direct/range {v1 .. v7}, Lg3/c;-><init>(Lg3/e;Landroid/content/Context;ZLjava/lang/String;Ljava/lang/String;Lg3/e;)V

    invoke-virtual {v0, v9}, Lg3/e;->l(Ljava/lang/Runnable;)V
    :try_end_45
    .catchall {:try_start_c .. :try_end_45} :catchall_93

    :goto_45
    monitor-exit v0

    .line 4
    sget-object v1, Lo4/b$a;->r:Lo4/b$a;

    const/4 v2, 0x4

    and-int/2addr v2, v2

    const-string v3, ""

    if-eqz v2, :cond_4f

    move-object v8, v3

    :cond_4f
    const-string v2, "key"

    .line 5
    invoke-static {v1, v2}, Lx/e;->f(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v2, "default"

    invoke-static {v8, v2}, Lx/e;->f(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v2, "game_centre"

    const/4 v4, 0x0

    invoke-virtual {p1, v2, v4}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v2

    invoke-virtual {v1}, Ljava/lang/Enum;->name()Ljava/lang/String;

    move-result-object v1

    invoke-interface {v2, v1, v8}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    if-nez v1, :cond_6b

    goto :goto_6c

    :cond_6b
    move-object v3, v1

    :goto_6c
    const-string v1, "setUserId()"

    .line 6
    invoke-virtual {v0, v1}, Lg3/e;->c(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_75

    goto :goto_7d

    :cond_75
    new-instance v1, Lg3/k;

    invoke-direct {v1, v0, v0, v4, v3}, Lg3/k;-><init>(Lg3/e;Lg3/e;ZLjava/lang/String;)V

    invoke-virtual {v0, v1}, Lg3/e;->l(Ljava/lang/Runnable;)V

    .line 7
    :goto_7d
    iget-boolean v1, v0, Lg3/e;->A:Z

    if-nez v1, :cond_92

    const-string v1, "enableForegroundTracking()"

    invoke-virtual {v0, v1}, Lg3/e;->c(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_8a

    goto :goto_92

    :cond_8a
    new-instance v1, Lg3/b;

    invoke-direct {v1, v0}, Lg3/b;-><init>(Lg3/e;)V

    invoke-virtual {p1, v1}, Landroid/app/Application;->registerActivityLifecycleCallbacks(Landroid/app/Application$ActivityLifecycleCallbacks;)V

    :cond_92
    :goto_92
    return-void

    :catchall_93
    move-exception p1

    .line 8
    monitor-exit v0

    throw p1
.end method

.method public final postEvent(Lcom/floydwiz/gamingcenter/utils/network/AnalyticsHelper$a;Lorg/json/JSONObject;)V
    .registers 4

    const-string v0, "name"

    invoke-static {p1, v0}, Lx/e;->f(Ljava/lang/Object;Ljava/lang/String;)V

    if-nez p2, :cond_14

    invoke-static {}, Lg3/a;->a()Lg3/e;

    move-result-object p2

    invoke-virtual {p1}, Ljava/lang/Enum;->name()Ljava/lang/String;

    move-result-object p1

    const/4 v0, 0x0

    .line 1
    invoke-virtual {p2, p1, v0}, Lg3/e;->g(Ljava/lang/String;Lorg/json/JSONObject;)V

    goto :goto_1f

    .line 2
    :cond_14
    invoke-static {}, Lg3/a;->a()Lg3/e;

    move-result-object v0

    invoke-virtual {p1}, Ljava/lang/Enum;->name()Ljava/lang/String;

    move-result-object p1

    invoke-virtual {v0, p1, p2}, Lg3/e;->g(Ljava/lang/String;Lorg/json/JSONObject;)V

    :goto_1f
    return-void
.end method
