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


# annotations
.annotation runtime Ljavax/annotation/ParametersAreNonnullByDefault;
.end annotation


# instance fields
.field private zza:Landroid/content/Context;

.field private zzb:J


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

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

    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/google/android/gms/ads/internal/zze;->zzb:J

    return-void
.end method


# virtual methods
.method public final zza(Landroid/content/Context;Lz5/g50;Ljava/lang/String;Ljava/lang/Runnable;)V
    .registers 13

    const/4 v3, 0x1

    const/4 v4, 0x0

    const/4 v6, 0x0

    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move-object v5, p3

    move-object v7, p4

    invoke-virtual/range {v0 .. v7}, Lcom/google/android/gms/ads/internal/zze;->zzc(Landroid/content/Context;Lz5/g50;ZLz5/s40;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Runnable;)V

    return-void
.end method

.method public final zzb(Landroid/content/Context;Lz5/g50;Ljava/lang/String;Lz5/s40;)V
    .registers 14

    if-eqz p4, :cond_5

    .line 1
    iget-object v0, p4, Lz5/s40;->d:Ljava/lang/String;

    goto :goto_6

    :cond_5
    const/4 v0, 0x0

    :goto_6
    move-object v6, v0

    const/4 v4, 0x0

    const/4 v8, 0x0

    move-object v1, p0

    move-object v2, p1

    move-object v3, p2

    move-object v5, p4

    move-object v7, p3

    .line 2
    invoke-virtual/range {v1 .. v8}, Lcom/google/android/gms/ads/internal/zze;->zzc(Landroid/content/Context;Lz5/g50;ZLz5/s40;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Runnable;)V

    return-void
.end method

.method public final zzc(Landroid/content/Context;Lz5/g50;ZLz5/s40;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Runnable;)V
    .registers 13

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

    move-result-object v0

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

    move-result-wide v0

    iget-wide v2, p0, Lcom/google/android/gms/ads/internal/zze;->zzb:J

    sub-long/2addr v0, v2

    const-wide/16 v2, 0x1388

    cmp-long v0, v0, v2

    if-gez v0, :cond_17

    const-string p1, "Not retrying to fetch app settings"

    invoke-static {p1}, Lz5/d50;->zzi(Ljava/lang/String;)V

    return-void

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

    move-result-object v0

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

    move-result-wide v0

    iput-wide v0, p0, Lcom/google/android/gms/ads/internal/zze;->zzb:J

    if-nez p4, :cond_24

    goto :goto_48

    .line 1
    :cond_24
    iget-wide v0, p4, Lz5/s40;->f:J

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

    move-result-object v2

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

    move-result-wide v2

    sget-object v4, Lz5/so;->l2:Lz5/no;

    sub-long/2addr v2, v0

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

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

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

    move-result-object v0

    check-cast v0, Ljava/lang/Long;

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

    move-result-wide v0

    cmp-long v0, v2, v0

    if-gtz v0, :cond_48

    .line 5
    iget-boolean p4, p4, Lz5/s40;->h:Z

    if-eqz p4, :cond_48

    return-void

    :cond_48
    :goto_48
    if-nez p1, :cond_50

    const-string p1, "Context not provided to fetch application settings"

    .line 6
    invoke-static {p1}, Lz5/d50;->zzi(Ljava/lang/String;)V

    return-void

    :cond_50
    invoke-static {p5}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result p4

    if-eqz p4, :cond_63

    invoke-static {p6}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result p4

    if-nez p4, :cond_5d

    goto :goto_63

    :cond_5d
    const-string p1, "App settings could not be fetched. Required parameters missing"

    invoke-static {p1}, Lz5/d50;->zzi(Ljava/lang/String;)V

    return-void

    :cond_63
    :goto_63
    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object p4

    if-nez p4, :cond_6a

    move-object p4, p1

    :cond_6a
    iput-object p4, p0, Lcom/google/android/gms/ads/internal/zze;->zza:Landroid/content/Context;

    invoke-static {}, Lcom/google/android/gms/ads/internal/zzt;->zzp()Lcom/google/android/gms/internal/ads/v0;

    move-result-object p4

    iget-object v0, p0, Lcom/google/android/gms/ads/internal/zze;->zza:Landroid/content/Context;

    invoke-virtual {p4, v0, p2}, Lcom/google/android/gms/internal/ads/v0;->b(Landroid/content/Context;Lz5/g50;)Lcom/google/android/gms/internal/ads/w0;

    move-result-object p2

    sget-object p4, Lz5/yw;->b:Lz5/li;

    .line 7
    new-instance v0, Lcom/google/android/gms/internal/ads/x0;

    iget-object p2, p2, Lcom/google/android/gms/internal/ads/w0;->a:Lcom/google/android/gms/internal/ads/u0;

    const-string v1, "google.afma.config.fetchAppSettings"

    invoke-direct {v0, p2, v1, p4, p4}, Lcom/google/android/gms/internal/ads/x0;-><init>(Lcom/google/android/gms/internal/ads/u0;Ljava/lang/String;Lz5/vw;Lz5/uw;)V

    .line 8
    :try_start_81
    new-instance p2, Lorg/json/JSONObject;

    invoke-direct {p2}, Lorg/json/JSONObject;-><init>()V

    invoke-static {p5}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result p4

    if-nez p4, :cond_92

    const-string p4, "app_id"

    invoke-virtual {p2, p4, p5}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    goto :goto_9d

    :cond_92
    invoke-static {p6}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result p4

    if-nez p4, :cond_9d

    const-string p4, "ad_unit_id"

    invoke-virtual {p2, p4, p6}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    :cond_9d
    :goto_9d
    const-string p4, "is_init"

    invoke-virtual {p2, p4, p3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;

    const-string p3, "pn"

    invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object p4

    invoke-virtual {p2, p3, p4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string p3, "experiment_ids"

    const-string p4, ","

    invoke-static {}, Lz5/so;->b()Ljava/util/List;

    move-result-object p5

    invoke-static {p4, p5}, Landroid/text/TextUtils;->join(Ljava/lang/CharSequence;Ljava/lang/Iterable;)Ljava/lang/String;

    move-result-object p4

    invoke-virtual {p2, p3, p4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_ba
    .catch Ljava/lang/Exception; {:try_start_81 .. :try_end_ba} :catch_f3

    :try_start_ba
    iget-object p3, p0, Lcom/google/android/gms/ads/internal/zze;->zza:Landroid/content/Context;

    invoke-virtual {p3}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;

    move-result-object p3

    if-eqz p3, :cond_dc

    invoke-static {p1}, Lw5/c;->a(Landroid/content/Context;)Lw5/b;

    move-result-object p1

    iget-object p3, p3, Landroid/content/pm/ApplicationInfo;->packageName:Ljava/lang/String;

    const/4 p4, 0x0

    invoke-virtual {p1, p3, p4}, Lw5/b;->c(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;

    move-result-object p1

    if-eqz p1, :cond_dc

    const-string p3, "version"

    iget p1, p1, Landroid/content/pm/PackageInfo;->versionCode:I

    invoke-virtual {p2, p3, p1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;
    :try_end_d6
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_ba .. :try_end_d6} :catch_d7
    .catch Ljava/lang/Exception; {:try_start_ba .. :try_end_d6} :catch_f3

    goto :goto_dc

    :catch_d7
    :try_start_d7
    const-string p1, "Error fetching PackageInfo."

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

    :cond_dc
    :goto_dc
    invoke-virtual {v0, p2}, Lcom/google/android/gms/internal/ads/x0;->a(Ljava/lang/Object;)Lz5/fc1;

    move-result-object p1

    sget-object p2, Lcom/google/android/gms/ads/internal/zzd;->zza:Lz5/sb1;

    sget-object p3, Lz5/k50;->f:Lz5/gc1;

    invoke-static {p1, p2, p3}, Lcom/google/android/gms/internal/ads/h8;->u(Lz5/fc1;Lz5/sb1;Ljava/util/concurrent/Executor;)Lz5/fc1;

    move-result-object p2

    if-eqz p7, :cond_ed

    invoke-interface {p1, p7, p3}, Lz5/fc1;->zze(Ljava/lang/Runnable;Ljava/util/concurrent/Executor;)V

    :cond_ed
    const-string p1, "ConfigLoader.maybeFetchNewAppSettings"

    invoke-static {p2, p1}, Lcom/google/android/gms/internal/ads/p8;->b(Lz5/fc1;Ljava/lang/String;)V
    :try_end_f2
    .catch Ljava/lang/Exception; {:try_start_d7 .. :try_end_f2} :catch_f3

    return-void

    :catch_f3
    move-exception p1

    const-string p2, "Error requesting application settings"

    invoke-static {p2, p1}, Lz5/d50;->zzg(Ljava/lang/String;Ljava/lang/Throwable;)V

    return-void
.end method
