.class public final Lcom/google/android/gms/internal/ads/w;
.super Ljava/lang/Object;
.source ""


# instance fields
.field public final a:Lz5/ng;

.field public final b:Lz5/rh;
    .annotation build Ljavax/annotation/concurrent/GuardedBy;
        value = "this"
    .end annotation
.end field

.field public final c:Z


# direct methods
.method public constructor <init>()V
    .registers 2

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

    invoke-static {}, Lz5/sh;->z()Lz5/rh;

    move-result-object v0

    iput-object v0, p0, Lcom/google/android/gms/internal/ads/w;->b:Lz5/rh;

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/google/android/gms/internal/ads/w;->c:Z

    new-instance v0, Lz5/ng;

    invoke-direct {v0}, Lz5/ng;-><init>()V

    iput-object v0, p0, Lcom/google/android/gms/internal/ads/w;->a:Lz5/ng;

    return-void
.end method

.method public constructor <init>(Lz5/ng;)V
    .registers 3

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

    invoke-static {}, Lz5/sh;->z()Lz5/rh;

    move-result-object v0

    iput-object v0, p0, Lcom/google/android/gms/internal/ads/w;->b:Lz5/rh;

    iput-object p1, p0, Lcom/google/android/gms/internal/ads/w;->a:Lz5/ng;

    sget-object p1, Lz5/so;->V2:Lz5/no;

    .line 1
    sget-object v0, Lz5/xk;->d:Lz5/xk;

    iget-object v0, v0, Lz5/xk;->c:Lcom/google/android/gms/internal/ads/g0;

    .line 2
    invoke-virtual {v0, p1}, Lcom/google/android/gms/internal/ads/g0;->a(Lz5/no;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ljava/lang/Boolean;

    invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z

    move-result p1

    iput-boolean p1, p0, Lcom/google/android/gms/internal/ads/w;->c:Z

    return-void
.end method


# virtual methods
.method public final declared-synchronized a(Lz5/mg;)V
    .registers 5

    monitor-enter p0

    :try_start_1
    iget-boolean v0, p0, Lcom/google/android/gms/internal/ads/w;->c:Z
    :try_end_3
    .catchall {:try_start_1 .. :try_end_3} :catchall_22

    if-eqz v0, :cond_20

    :try_start_5
    iget-object v0, p0, Lcom/google/android/gms/internal/ads/w;->b:Lz5/rh;

    invoke-interface {p1, v0}, Lz5/mg;->a(Lz5/rh;)V
    :try_end_a
    .catch Ljava/lang/NullPointerException; {:try_start_5 .. :try_end_a} :catch_c
    .catchall {:try_start_5 .. :try_end_a} :catchall_22

    monitor-exit p0

    return-void

    :catch_c
    move-exception p1

    :try_start_d
    invoke-static {}, Lcom/google/android/gms/ads/internal/zzt;->zzg()Lcom/google/android/gms/internal/ads/u1;

    move-result-object v0

    const-string v1, "AdMobClearcutLogger.modify"

    .line 1
    iget-object v2, v0, Lcom/google/android/gms/internal/ads/u1;->e:Landroid/content/Context;

    iget-object v0, v0, Lcom/google/android/gms/internal/ads/u1;->f:Lz5/g50;

    invoke-static {v2, v0}, Lcom/google/android/gms/internal/ads/h1;->d(Landroid/content/Context;Lz5/g50;)Lz5/f10;

    move-result-object v0

    invoke-interface {v0, p1, v1}, Lz5/f10;->a(Ljava/lang/Throwable;Ljava/lang/String;)V
    :try_end_1e
    .catchall {:try_start_d .. :try_end_1e} :catchall_22

    .line 2
    monitor-exit p0

    return-void

    :cond_20
    monitor-exit p0

    return-void

    :catchall_22
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public final declared-synchronized b(I)V
    .registers 4

    monitor-enter p0

    :try_start_1
    iget-boolean v0, p0, Lcom/google/android/gms/internal/ads/w;->c:Z
    :try_end_3
    .catchall {:try_start_1 .. :try_end_3} :catchall_23

    if-nez v0, :cond_7

    monitor-exit p0

    return-void

    :cond_7
    :try_start_7
    sget-object v0, Lz5/so;->W2:Lz5/no;

    .line 1
    sget-object v1, Lz5/xk;->d:Lz5/xk;

    iget-object v1, v1, Lz5/xk;->c:Lcom/google/android/gms/internal/ads/g0;

    .line 2
    invoke-virtual {v1, v0}, Lcom/google/android/gms/internal/ads/g0;->a(Lz5/no;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Boolean;

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    if-eqz v0, :cond_1e

    invoke-virtual {p0, p1}, Lcom/google/android/gms/internal/ads/w;->d(I)V
    :try_end_1c
    .catchall {:try_start_7 .. :try_end_1c} :catchall_23

    monitor-exit p0

    return-void

    :cond_1e
    :try_start_1e
    invoke-virtual {p0, p1}, Lcom/google/android/gms/internal/ads/w;->c(I)V
    :try_end_21
    .catchall {:try_start_1e .. :try_end_21} :catchall_23

    monitor-exit p0

    return-void

    :catchall_23
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public final declared-synchronized c(I)V
    .registers 10

    monitor-enter p0

    :try_start_1
    iget-object v0, p0, Lcom/google/android/gms/internal/ads/w;->b:Lz5/rh;

    .line 1
    iget-boolean v1, v0, Lz5/uk1;->t:Z

    const/4 v2, 0x0

    if-eqz v1, :cond_d

    invoke-virtual {v0}, Lz5/uk1;->i()V

    iput-boolean v2, v0, Lz5/uk1;->t:Z

    :cond_d
    iget-object v1, v0, Lz5/uk1;->s:Lz5/xk1;

    check-cast v1, Lz5/sh;

    invoke-static {v1}, Lz5/sh;->D(Lz5/sh;)V

    .line 2
    invoke-static {}, Lz5/so;->c()Ljava/util/List;

    move-result-object v1

    new-instance v3, Ljava/util/ArrayList;

    invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V

    check-cast v1, Ljava/util/ArrayList;

    invoke-virtual {v1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_23
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_4b

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/String;

    const-string v5, ","

    invoke-virtual {v4, v5}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v4

    array-length v5, v4

    move v6, v2

    :goto_37
    if-ge v6, v5, :cond_23

    aget-object v7, v4, v6
    :try_end_3b
    .catchall {:try_start_1 .. :try_end_3b} :catchall_b4

    :try_start_3b
    invoke-static {v7}, Ljava/lang/Long;->valueOf(Ljava/lang/String;)Ljava/lang/Long;

    move-result-object v7

    invoke-virtual {v3, v7}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_42
    .catch Ljava/lang/NumberFormatException; {:try_start_3b .. :try_end_42} :catch_43
    .catchall {:try_start_3b .. :try_end_42} :catchall_b4

    goto :goto_48

    :catch_43
    :try_start_43
    const-string v7, "Experiment ID is not a number"

    invoke-static {v7}, Lcom/google/android/gms/ads/internal/util/zze;->zza(Ljava/lang/String;)V

    :goto_48
    add-int/lit8 v6, v6, 0x1

    goto :goto_37

    .line 3
    :cond_4b
    iget-boolean v1, v0, Lz5/uk1;->t:Z

    if-eqz v1, :cond_54

    invoke-virtual {v0}, Lz5/uk1;->i()V

    iput-boolean v2, v0, Lz5/uk1;->t:Z

    :cond_54
    iget-object v0, v0, Lz5/uk1;->s:Lz5/xk1;

    check-cast v0, Lz5/sh;

    invoke-static {v0, v3}, Lz5/sh;->C(Lz5/sh;Ljava/lang/Iterable;)V

    .line 4
    iget-object v0, p0, Lcom/google/android/gms/internal/ads/w;->a:Lz5/ng;

    iget-object v1, p0, Lcom/google/android/gms/internal/ads/w;->b:Lz5/rh;

    invoke-virtual {v1}, Lz5/uk1;->m()Lz5/xk1;

    move-result-object v1

    check-cast v1, Lz5/sh;

    invoke-virtual {v1}, Lz5/pj1;->j()[B

    move-result-object v1
    :try_end_69
    .catchall {:try_start_43 .. :try_end_69} :catchall_b4

    add-int/lit8 p1, p1, -0x1

    .line 5
    :try_start_6b
    iget-boolean v3, v0, Lz5/ng;->b:Z

    if-eqz v3, :cond_92

    iget-object v3, v0, Lz5/ng;->a:Lz5/u7;

    invoke-interface {v3, v1}, Lz5/u7;->D0([B)V

    iget-object v1, v0, Lz5/ng;->a:Lz5/u7;

    invoke-interface {v1, v2}, Lz5/u7;->d0(I)V

    iget-object v1, v0, Lz5/ng;->a:Lz5/u7;

    invoke-interface {v1, p1}, Lz5/u7;->R0(I)V

    iget-object v1, v0, Lz5/ng;->a:Lz5/u7;

    const/4 v2, 0x0

    invoke-interface {v1, v2}, Lz5/u7;->Q([I)V

    iget-object v0, v0, Lz5/ng;->a:Lz5/u7;

    invoke-interface {v0}, Lz5/u7;->zzf()V
    :try_end_89
    .catch Landroid/os/RemoteException; {:try_start_6b .. :try_end_89} :catch_8c
    .catchall {:try_start_6b .. :try_end_89} :catchall_8a

    goto :goto_92

    :catchall_8a
    move-exception p1

    goto :goto_b3

    :catch_8c
    move-exception v0

    :try_start_8d
    const-string v1, "Clearcut log failed"

    invoke-static {v1, v0}, Lz5/d50;->zze(Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_92
    .catchall {:try_start_8d .. :try_end_92} :catchall_8a

    :cond_92
    :goto_92
    const/16 v0, 0xa

    .line 6
    :try_start_94
    invoke-static {p1, v0}, Ljava/lang/Integer;->toString(II)Ljava/lang/String;

    move-result-object p1

    invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p1

    const-string v0, "Logging Event with event code : "

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v1

    if-eqz v1, :cond_a9

    invoke-virtual {v0, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    goto :goto_ae

    :cond_a9
    new-instance p1, Ljava/lang/String;

    invoke-direct {p1, v0}, Ljava/lang/String;-><init>(Ljava/lang/String;)V

    :goto_ae
    invoke-static {p1}, Lcom/google/android/gms/ads/internal/util/zze;->zza(Ljava/lang/String;)V
    :try_end_b1
    .catchall {:try_start_94 .. :try_end_b1} :catchall_b4

    monitor-exit p0

    return-void

    .line 7
    :goto_b3
    :try_start_b3
    throw p1
    :try_end_b4
    .catchall {:try_start_b3 .. :try_end_b4} :catchall_b4

    :catchall_b4
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public final declared-synchronized d(I)V
    .registers 5

    monitor-enter p0

    :try_start_1
    invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;

    move-result-object v0
    :try_end_5
    .catchall {:try_start_1 .. :try_end_5} :catchall_51

    if-nez v0, :cond_9

    monitor-exit p0

    return-void

    :cond_9
    :try_start_9
    new-instance v1, Ljava/io/File;

    const-string v2, "clearcut_events.txt"

    invoke-direct {v1, v0, v2}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
    :try_end_10
    .catchall {:try_start_9 .. :try_end_10} :catchall_51

    :try_start_10
    new-instance v0, Ljava/io/FileOutputStream;

    const/4 v2, 0x1

    invoke-direct {v0, v1, v2}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;Z)V
    :try_end_16
    .catch Ljava/io/FileNotFoundException; {:try_start_10 .. :try_end_16} :catch_4a
    .catchall {:try_start_10 .. :try_end_16} :catchall_51

    :try_start_16
    invoke-virtual {p0, p1}, Lcom/google/android/gms/internal/ads/w;->e(I)Ljava/lang/String;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B

    move-result-object p1

    invoke-virtual {v0, p1}, Ljava/io/FileOutputStream;->write([B)V
    :try_end_21
    .catch Ljava/io/IOException; {:try_start_16 .. :try_end_21} :catch_2f
    .catchall {:try_start_16 .. :try_end_21} :catchall_2d

    :try_start_21
    invoke-virtual {v0}, Ljava/io/FileOutputStream;->close()V
    :try_end_24
    .catch Ljava/io/IOException; {:try_start_21 .. :try_end_24} :catch_26
    .catchall {:try_start_21 .. :try_end_24} :catchall_51

    monitor-exit p0

    return-void

    :catch_26
    :try_start_26
    const-string p1, "Could not close Clearcut output stream."

    invoke-static {p1}, Lcom/google/android/gms/ads/internal/util/zze;->zza(Ljava/lang/String;)V
    :try_end_2b
    .catch Ljava/io/FileNotFoundException; {:try_start_26 .. :try_end_2b} :catch_4a
    .catchall {:try_start_26 .. :try_end_2b} :catchall_51

    monitor-exit p0

    return-void

    :catchall_2d
    move-exception p1

    goto :goto_40

    :catch_2f
    :try_start_2f
    const-string p1, "Could not write Clearcut to file."

    invoke-static {p1}, Lcom/google/android/gms/ads/internal/util/zze;->zza(Ljava/lang/String;)V
    :try_end_34
    .catchall {:try_start_2f .. :try_end_34} :catchall_2d

    :try_start_34
    invoke-virtual {v0}, Ljava/io/FileOutputStream;->close()V
    :try_end_37
    .catch Ljava/io/IOException; {:try_start_34 .. :try_end_37} :catch_39
    .catchall {:try_start_34 .. :try_end_37} :catchall_51

    monitor-exit p0

    return-void

    :catch_39
    :try_start_39
    const-string p1, "Could not close Clearcut output stream."

    invoke-static {p1}, Lcom/google/android/gms/ads/internal/util/zze;->zza(Ljava/lang/String;)V
    :try_end_3e
    .catch Ljava/io/FileNotFoundException; {:try_start_39 .. :try_end_3e} :catch_4a
    .catchall {:try_start_39 .. :try_end_3e} :catchall_51

    monitor-exit p0

    return-void

    :goto_40
    :try_start_40
    invoke-virtual {v0}, Ljava/io/FileOutputStream;->close()V
    :try_end_43
    .catch Ljava/io/IOException; {:try_start_40 .. :try_end_43} :catch_44
    .catchall {:try_start_40 .. :try_end_43} :catchall_51

    goto :goto_49

    :catch_44
    :try_start_44
    const-string v0, "Could not close Clearcut output stream."

    invoke-static {v0}, Lcom/google/android/gms/ads/internal/util/zze;->zza(Ljava/lang/String;)V

    :goto_49
    throw p1
    :try_end_4a
    .catch Ljava/io/FileNotFoundException; {:try_start_44 .. :try_end_4a} :catch_4a
    .catchall {:try_start_44 .. :try_end_4a} :catchall_51

    :catch_4a
    :try_start_4a
    const-string p1, "Could not find file for Clearcut"

    invoke-static {p1}, Lcom/google/android/gms/ads/internal/util/zze;->zza(Ljava/lang/String;)V
    :try_end_4f
    .catchall {:try_start_4a .. :try_end_4f} :catchall_51

    monitor-exit p0

    return-void

    :catchall_51
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public final declared-synchronized e(I)Ljava/lang/String;
    .registers 6

    monitor-enter p0

    const/4 v0, 0x4

    :try_start_2
    new-array v0, v0, [Ljava/lang/Object;

    const/4 v1, 0x0

    iget-object v2, p0, Lcom/google/android/gms/internal/ads/w;->b:Lz5/rh;

    .line 1
    iget-object v2, v2, Lz5/uk1;->s:Lz5/xk1;

    check-cast v2, Lz5/sh;

    invoke-virtual {v2}, Lz5/sh;->w()Ljava/lang/String;

    move-result-object v2

    aput-object v2, v0, v1

    const/4 v1, 0x1

    .line 2
    invoke-static {}, Lcom/google/android/gms/ads/internal/zzt;->zzj()Lu5/c;

    move-result-object v2

    invoke-interface {v2}, Lu5/c;->c()J

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v2

    aput-object v2, v0, v1

    const/4 v1, 0x2

    add-int/lit8 p1, p1, -0x1

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p1

    aput-object p1, v0, v1

    iget-object p1, p0, Lcom/google/android/gms/internal/ads/w;->b:Lz5/rh;

    invoke-virtual {p1}, Lz5/uk1;->m()Lz5/xk1;

    move-result-object p1

    check-cast p1, Lz5/sh;

    invoke-virtual {p1}, Lz5/pj1;->j()[B

    move-result-object p1

    const/4 v1, 0x3

    invoke-static {p1, v1}, Landroid/util/Base64;->encodeToString([BI)Ljava/lang/String;

    move-result-object p1

    aput-object p1, v0, v1

    const-string p1, "id=%s,timestamp=%s,event=%s,data=%s\n"

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

    move-result-object p1
    :try_end_42
    .catchall {:try_start_2 .. :try_end_42} :catchall_44

    monitor-exit p0

    return-object p1

    :catchall_44
    move-exception p1

    monitor-exit p0

    throw p1
.end method
