.class public Lg3/c;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Ljava/lang/Runnable;


# instance fields
.field public final synthetic r:Landroid/content/Context;

.field public final synthetic s:Z

.field public final synthetic t:Ljava/lang/String;

.field public final synthetic u:Ljava/lang/String;

.field public final synthetic v:Lg3/e;

.field public final synthetic w:Lg3/e;


# direct methods
.method public constructor <init>(Lg3/e;Landroid/content/Context;ZLjava/lang/String;Ljava/lang/String;Lg3/e;)V
    .registers 7

    iput-object p1, p0, Lg3/c;->w:Lg3/e;

    iput-object p2, p0, Lg3/c;->r:Landroid/content/Context;

    iput-boolean p3, p0, Lg3/c;->s:Z

    iput-object p4, p0, Lg3/c;->t:Ljava/lang/String;

    iput-object p5, p0, Lg3/c;->u:Ljava/lang/String;

    iput-object p6, p0, Lg3/c;->v:Lg3/e;

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

    return-void
.end method


# virtual methods
.method public run()V
    .registers 11

    iget-object v0, p0, Lg3/c;->w:Lg3/e;

    iget-boolean v1, v0, Lg3/e;->h:Z

    if-nez v1, :cond_105

    const/4 v1, 0x0

    const/4 v2, 0x1

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

    const-string v3, "$default_instance"

    invoke-virtual {v0, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1c

    iget-object v0, p0, Lg3/c;->r:Landroid/content/Context;

    invoke-static {v0}, Lg3/e;->v(Landroid/content/Context;)Z

    iget-object v0, p0, Lg3/c;->r:Landroid/content/Context;

    invoke-static {v0}, Lg3/e;->w(Landroid/content/Context;)Z

    :cond_1c
    iget-object v0, p0, Lg3/c;->w:Lg3/e;

    new-instance v3, Lv9/a0;

    .line 1
    new-instance v4, Lv9/a0$a;

    invoke-direct {v4}, Lv9/a0$a;-><init>()V

    invoke-direct {v3, v4}, Lv9/a0;-><init>(Lv9/a0$a;)V

    .line 2
    iput-object v3, v0, Lg3/e;->b:Lv9/a0;

    iget-object v0, p0, Lg3/c;->w:Lg3/e;

    new-instance v3, Lg3/p;

    iget-object v4, p0, Lg3/c;->r:Landroid/content/Context;

    invoke-direct {v3, v4}, Lg3/p;-><init>(Landroid/content/Context;)V

    .line 3
    iput-object v3, v0, Lg3/e;->r:Lg3/p;

    .line 4
    invoke-static {v0}, Lg3/e;->a(Lg3/e;)Ljava/lang/String;

    move-result-object v3

    iput-object v3, v0, Lg3/e;->g:Ljava/lang/String;

    iget-boolean v0, p0, Lg3/c;->s:Z

    if-eqz v0, :cond_53

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

    move-result-object v0

    iget-object v3, p0, Lg3/c;->w:Lg3/e;

    iget-object v4, v3, Lg3/e;->b:Lv9/a0;

    iget-object v5, p0, Lg3/c;->t:Ljava/lang/String;

    iget-object v3, v3, Lg3/e;->g:Ljava/lang/String;

    .line 5
    iput-boolean v2, v0, Lg3/q;->a:Z

    iput-object v5, v0, Lg3/q;->b:Ljava/lang/String;

    iput-object v4, v0, Lg3/q;->c:Lv9/a0;

    iput-object v3, v0, Lg3/q;->d:Ljava/lang/String;

    .line 6
    :cond_53
    iget-object v0, p0, Lg3/c;->w:Lg3/e;

    .line 7
    iget-object v0, v0, Lg3/e;->r:Lg3/p;

    .line 8
    invoke-virtual {v0}, Lg3/p;->b()Lg3/p$b;

    .line 9
    iget-object v0, p0, Lg3/c;->u:Ljava/lang/String;
    :try_end_5c
    .catch Lg3/m; {:try_start_8 .. :try_end_5c} :catch_e1

    const-string v3, "user_id"

    if-eqz v0, :cond_6c

    :try_start_60
    iget-object v4, p0, Lg3/c;->v:Lg3/e;

    iput-object v0, v4, Lg3/e;->f:Ljava/lang/String;

    iget-object v4, p0, Lg3/c;->w:Lg3/e;

    iget-object v4, v4, Lg3/e;->c:Lg3/n;

    invoke-virtual {v4, v3, v0}, Lg3/n;->b0(Ljava/lang/String;Ljava/lang/String;)J

    goto :goto_78

    :cond_6c
    iget-object v0, p0, Lg3/c;->v:Lg3/e;

    iget-object v4, p0, Lg3/c;->w:Lg3/e;

    iget-object v4, v4, Lg3/e;->c:Lg3/n;

    invoke-virtual {v4, v3}, Lg3/n;->T(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    iput-object v3, v0, Lg3/e;->f:Ljava/lang/String;

    :goto_78
    iget-object v0, p0, Lg3/c;->w:Lg3/e;

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

    const-string v3, "opt_out"

    invoke-virtual {v0, v3}, Lg3/n;->K(Ljava/lang/String;)Ljava/lang/Long;

    move-result-object v0

    iget-object v3, p0, Lg3/c;->w:Lg3/e;

    if-eqz v0, :cond_92

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v4

    const-wide/16 v6, 0x1

    cmp-long v0, v4, v6

    if-nez v0, :cond_92

    move v0, v2

    goto :goto_93

    :cond_92
    move v0, v1

    .line 10
    :goto_93
    iput-boolean v0, v3, Lg3/e;->i:Z

    .line 11
    iget-object v0, p0, Lg3/c;->w:Lg3/e;

    const-string v3, "previous_session_id"

    const-wide/16 v4, -0x1

    invoke-static {v0, v3, v4, v5}, Lg3/e;->b(Lg3/e;Ljava/lang/String;J)J

    move-result-wide v6

    iput-wide v6, v0, Lg3/e;->q:J

    iget-object v0, p0, Lg3/c;->w:Lg3/e;

    iget-wide v6, v0, Lg3/e;->q:J

    const-wide/16 v8, 0x0

    cmp-long v3, v6, v8

    if-ltz v3, :cond_ad

    iput-wide v6, v0, Lg3/e;->l:J

    :cond_ad
    const-string v3, "sequence_number"

    invoke-static {v0, v3, v8, v9}, Lg3/e;->b(Lg3/e;Ljava/lang/String;J)J

    move-result-wide v6

    iput-wide v6, v0, Lg3/e;->m:J

    iget-object v0, p0, Lg3/c;->w:Lg3/e;

    const-string v3, "last_event_id"

    invoke-static {v0, v3, v4, v5}, Lg3/e;->b(Lg3/e;Ljava/lang/String;J)J

    move-result-wide v6

    iput-wide v6, v0, Lg3/e;->n:J

    iget-object v0, p0, Lg3/c;->w:Lg3/e;

    const-string v3, "last_identify_id"

    invoke-static {v0, v3, v4, v5}, Lg3/e;->b(Lg3/e;Ljava/lang/String;J)J

    move-result-wide v6

    iput-wide v6, v0, Lg3/e;->o:J

    iget-object v0, p0, Lg3/c;->w:Lg3/e;

    const-string v3, "last_event_time"

    invoke-static {v0, v3, v4, v5}, Lg3/e;->b(Lg3/e;Ljava/lang/String;J)J

    move-result-wide v3

    iput-wide v3, v0, Lg3/e;->p:J

    iget-object v0, p0, Lg3/c;->w:Lg3/e;

    iget-object v3, v0, Lg3/e;->c:Lg3/n;

    new-instance v4, Lg3/c$a;

    invoke-direct {v4, p0}, Lg3/c$a;-><init>(Lg3/c;)V

    .line 12
    iput-object v4, v3, Lg3/n;->t:Lg3/o;

    .line 13
    iput-boolean v2, v0, Lg3/e;->h:Z
    :try_end_e0
    .catch Lg3/m; {:try_start_60 .. :try_end_e0} :catch_e1

    goto :goto_105

    :catch_e1
    move-exception v0

    sget v3, Lg3/e;->I:I

    new-array v2, v2, [Ljava/lang/Object;

    invoke-virtual {v0}, Ljava/lang/RuntimeException;->getMessage()Ljava/lang/String;

    move-result-object v3

    aput-object v3, v2, v1

    const-string v1, "Failed to initialize Amplitude SDK due to: %s"

    invoke-static {v1, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

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

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

    .line 15
    invoke-static {}, Lg3/q;->a()Lg3/q;

    move-result-object v1

    const-string v2, "Failed to initialize Amplitude SDK"

    invoke-virtual {v1, v2, v0}, Lg3/q;->b(Ljava/lang/String;Ljava/lang/Throwable;)Lg3/q;

    iget-object v0, p0, Lg3/c;->v:Lg3/e;

    const/4 v1, 0x0

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

    :cond_105
    :goto_105
    return-void
.end method
