.class public final Lz5/l70;
.super Lcom/google/android/gms/internal/ads/e2;
.source ""

# interfaces
.implements Lz5/vd;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/google/android/gms/internal/ads/e2;",
        "Lz5/vd<",
        "Lz5/kd;",
        ">;"
    }
.end annotation


# instance fields
.field public A:Z

.field public final B:Ljava/lang/Object;

.field public final C:Ljava/lang/String;

.field public final D:I

.field public E:Z

.field public u:Ljava/lang/String;

.field public final v:Lz5/g60;

.field public w:Z

.field public final x:Lz5/k70;

.field public final y:Lz5/p8;

.field public z:Ljava/nio/ByteBuffer;


# direct methods
.method public constructor <init>(Lz5/h60;Lz5/g60;)V
    .registers 4

    invoke-direct {p0, p1}, Lcom/google/android/gms/internal/ads/e2;-><init>(Lz5/h60;)V

    iput-object p2, p0, Lz5/l70;->v:Lz5/g60;

    new-instance p2, Lz5/k70;

    invoke-direct {p2}, Lz5/k70;-><init>()V

    iput-object p2, p0, Lz5/l70;->x:Lz5/k70;

    new-instance p2, Lz5/p8;

    const/4 v0, 0x2

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

    iput-object p2, p0, Lz5/l70;->y:Lz5/p8;

    new-instance p2, Ljava/lang/Object;

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

    iput-object p2, p0, Lz5/l70;->B:Ljava/lang/Object;

    invoke-interface {p1}, Lz5/h60;->zzn()Ljava/lang/String;

    move-result-object p2

    iput-object p2, p0, Lz5/l70;->C:Ljava/lang/String;

    invoke-interface {p1}, Lz5/h60;->zzp()I

    move-result p1

    iput p1, p0, Lz5/l70;->D:I

    return-void
.end method

.method public static final t(Ljava/lang/String;)Ljava/lang/String;
    .registers 3

    invoke-static {p0}, Lz5/z40;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p0

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

    move-result-object p0

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

    move-result v0

    const-string v1, "cache:"

    if-eqz v0, :cond_15

    invoke-virtual {v1, p0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p0

    goto :goto_1a

    :cond_15
    new-instance p0, Ljava/lang/String;

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

    :goto_1a
    return-object p0
.end method


# virtual methods
.method public final f(Ljava/lang/String;)Z
    .registers 24

    move-object/from16 v1, p0

    move-object/from16 v2, p1

    iput-object v2, v1, Lz5/l70;->u:Ljava/lang/String;

    invoke-static/range {p1 .. p1}, Lz5/l70;->t(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    const-string v4, "error"

    const/4 v0, 0x0

    :try_start_d
    new-instance v7, Lz5/od;

    iget-object v5, v1, Lcom/google/android/gms/internal/ads/e2;->s:Ljava/lang/String;

    iget-object v6, v1, Lz5/l70;->v:Lz5/g60;

    iget v8, v6, Lz5/g60;->d:I

    iget v6, v6, Lz5/g60;->e:I

    invoke-direct {v7, v5, v1, v8, v6}, Lz5/od;-><init>(Ljava/lang/String;Lz5/vd;II)V

    iget-object v5, v1, Lz5/l70;->v:Lz5/g60;

    iget-boolean v5, v5, Lz5/g60;->i:Z

    if-eqz v5, :cond_2f

    new-instance v12, Lz5/q60;

    iget-object v6, v1, Lcom/google/android/gms/internal/ads/e2;->r:Landroid/content/Context;

    iget-object v8, v1, Lz5/l70;->C:Ljava/lang/String;

    iget v9, v1, Lz5/l70;->D:I

    const/4 v10, 0x0

    const/4 v11, 0x0

    move-object v5, v12

    invoke-direct/range {v5 .. v11}, Lz5/q60;-><init>(Landroid/content/Context;Lz5/kd;Ljava/lang/String;ILz5/vd;Lz5/ge0;)V

    move-object v7, v12

    :cond_2f
    invoke-static/range {p1 .. p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v9

    new-instance v5, Lz5/nd;

    const/4 v10, 0x0

    const-wide/16 v11, 0x0

    const-wide/16 v13, 0x0

    const-wide/16 v15, -0x1

    move-object v8, v5

    invoke-direct/range {v8 .. v16}, Lz5/nd;-><init>(Landroid/net/Uri;[BJJJ)V

    invoke-interface {v7, v5}, Lz5/kd;->e(Lz5/nd;)J

    iget-object v5, v1, Lcom/google/android/gms/internal/ads/e2;->t:Ljava/lang/ref/WeakReference;

    invoke-virtual {v5}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lz5/h60;

    if-eqz v5, :cond_50

    invoke-interface {v5, v3, v1}, Lz5/h60;->E(Ljava/lang/String;Lcom/google/android/gms/internal/ads/e2;)V

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

    move-result-object v5

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

    move-result-wide v8

    sget-object v6, Lz5/so;->q:Lz5/no;

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

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

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

    move-result-object v6

    check-cast v6, Ljava/lang/Long;

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

    move-result-wide v11

    sget-object v6, Lz5/so;->p:Lz5/no;

    .line 3
    iget-object v10, v10, Lz5/xk;->c:Lcom/google/android/gms/internal/ads/g0;

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

    move-result-object v6

    check-cast v6, Ljava/lang/Long;

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

    move-result-wide v13

    iget-object v6, v1, Lz5/l70;->v:Lz5/g60;

    iget v6, v6, Lz5/g60;->c:I

    invoke-static {v6}, Ljava/nio/ByteBuffer;->allocate(I)Ljava/nio/ByteBuffer;

    move-result-object v6

    iput-object v6, v1, Lz5/l70;->z:Ljava/nio/ByteBuffer;

    const/16 v6, 0x2000

    new-array v10, v6, [B
    :try_end_84
    .catch Ljava/lang/Exception; {:try_start_d .. :try_end_84} :catch_144

    move-object/from16 v17, v4

    move-wide v15, v8

    :goto_87
    :try_start_87
    iget-object v4, v1, Lz5/l70;->z:Ljava/nio/ByteBuffer;

    invoke-virtual {v4}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v4

    invoke-static {v4, v6}, Ljava/lang/Math;->min(II)I

    move-result v4

    invoke-interface {v7, v10, v0, v4}, Lz5/kd;->d([BII)I

    move-result v0

    const/4 v4, -0x1

    if-ne v0, v4, :cond_a9

    const/4 v0, 0x1

    iput-boolean v0, v1, Lz5/l70;->E:Z

    iget-object v0, v1, Lz5/l70;->y:Lz5/p8;

    iget-object v4, v1, Lz5/l70;->z:Ljava/nio/ByteBuffer;

    invoke-virtual {v0, v4}, Lz5/p8;->a(Ljava/nio/ByteBuffer;)J

    move-result-wide v4

    long-to-int v0, v4

    int-to-long v4, v0

    invoke-virtual {v1, v2, v3, v4, v5}, Lcom/google/android/gms/internal/ads/e2;->p(Ljava/lang/String;Ljava/lang/String;J)V

    goto :goto_c2

    :cond_a9
    iget-object v4, v1, Lz5/l70;->B:Ljava/lang/Object;

    monitor-enter v4
    :try_end_ac
    .catch Ljava/lang/Exception; {:try_start_87 .. :try_end_ac} :catch_135

    :try_start_ac
    iget-boolean v6, v1, Lz5/l70;->w:Z

    if-nez v6, :cond_b6

    iget-object v6, v1, Lz5/l70;->z:Ljava/nio/ByteBuffer;

    const/4 v2, 0x0

    invoke-virtual {v6, v10, v2, v0}, Ljava/nio/ByteBuffer;->put([BII)Ljava/nio/ByteBuffer;

    :cond_b6
    monitor-exit v4
    :try_end_b7
    .catchall {:try_start_ac .. :try_end_b7} :catchall_137

    :try_start_b7
    iget-object v0, v1, Lz5/l70;->z:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v0

    if-gtz v0, :cond_c4

    invoke-virtual/range {p0 .. p0}, Lz5/l70;->u()V

    :goto_c2
    const/4 v0, 0x1

    return v0

    :cond_c4
    iget-boolean v0, v1, Lz5/l70;->w:Z

    if-nez v0, :cond_107

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

    move-result-wide v18

    sub-long v20, v18, v15

    cmp-long v0, v20, v11

    if-ltz v0, :cond_d7

    invoke-virtual/range {p0 .. p0}, Lz5/l70;->u()V

    move-wide/from16 v15, v18

    :cond_d7
    sub-long v18, v18, v8

    const-wide/16 v20, 0x3e8

    mul-long v20, v20, v13

    cmp-long v0, v18, v20

    if-gtz v0, :cond_e7

    const/4 v0, 0x0

    const/16 v6, 0x2000

    move-object/from16 v2, p1

    goto :goto_87

    :cond_e7
    const-string v2, "downloadTimeout"
    :try_end_e9
    .catch Ljava/lang/Exception; {:try_start_b7 .. :try_end_e9} :catch_135

    :try_start_e9
    new-instance v0, Ljava/lang/StringBuilder;

    const/16 v4, 0x31

    invoke-direct {v0, v4}, Ljava/lang/StringBuilder;-><init>(I)V

    const-string v4, "Timeout exceeded. Limit: "

    invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, v13, v14}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v4, " sec"

    invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    new-instance v4, Ljava/io/IOException;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

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

    throw v4
    :try_end_107
    .catch Ljava/lang/Exception; {:try_start_e9 .. :try_end_107} :catch_12d

    :cond_107
    :try_start_107
    const-string v2, "externalAbort"
    :try_end_109
    .catch Ljava/lang/Exception; {:try_start_107 .. :try_end_109} :catch_135

    :try_start_109
    new-instance v0, Ljava/io/IOException;

    iget-object v4, v1, Lz5/l70;->z:Ljava/nio/ByteBuffer;

    invoke-virtual {v4}, Ljava/nio/ByteBuffer;->limit()I

    move-result v4

    new-instance v5, Ljava/lang/StringBuilder;

    const/16 v6, 0x23

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(I)V

    const-string v6, "Precache abort at "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v5, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v4, " bytes"

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

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

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

    throw v0
    :try_end_12d
    .catch Ljava/lang/Exception; {:try_start_109 .. :try_end_12d} :catch_12d

    :catch_12d
    move-exception v0

    move-object v6, v1

    move-object v4, v2

    move-object v5, v3

    move-object/from16 v2, p1

    move-object v3, v2

    goto :goto_14f

    :catch_135
    move-exception v0

    goto :goto_147

    :catchall_137
    move-exception v0

    move-object/from16 v2, p1

    move-object v6, v1

    move-object v5, v4

    move-object v4, v3

    move-object v3, v2

    :goto_13e
    :try_start_13e
    monitor-exit v5
    :try_end_13f
    .catchall {:try_start_13e .. :try_end_13f} :catchall_142

    :try_start_13f
    throw v0
    :try_end_140
    .catch Ljava/lang/Exception; {:try_start_13f .. :try_end_140} :catch_140

    :catch_140
    move-exception v0

    goto :goto_14c

    :catchall_142
    move-exception v0

    goto :goto_13e

    :catch_144
    move-exception v0

    move-object/from16 v17, v4

    :goto_147
    move-object/from16 v2, p1

    move-object v6, v1

    move-object v4, v3

    move-object v3, v2

    :goto_14c
    move-object v5, v4

    move-object/from16 v4, v17

    :goto_14f
    invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;

    move-result-object v7

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

    move-result-object v0

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

    move-result-object v8

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

    move-result v8

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

    move-result-object v9

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

    move-result v9

    new-instance v10, Ljava/lang/StringBuilder;

    add-int/lit8 v8, v8, 0x1

    add-int/2addr v8, v9

    invoke-direct {v10, v8}, Ljava/lang/StringBuilder;-><init>(I)V

    const-string v8, ":"

    invoke-static {v10, v7, v8, v0}, Li/b;->a(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

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

    move-result-object v3

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

    move-result v3

    new-instance v7, Ljava/lang/StringBuilder;

    add-int/lit8 v3, v3, 0x22

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

    move-result v8

    add-int/2addr v8, v3

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(I)V

    const-string v3, "Failed to preload url "

    invoke-virtual {v7, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v3, " Exception: "

    invoke-virtual {v7, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

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

    invoke-virtual {v6, v2, v5, v4, v0}, Lcom/google/android/gms/internal/ads/e2;->q(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    const/4 v0, 0x0

    return v0
.end method

.method public final m()V
    .registers 2

    const/4 v0, 0x1

    iput-boolean v0, p0, Lz5/l70;->w:Z

    return-void
.end method

.method public final bridge synthetic o(Ljava/lang/Object;I)V
    .registers 3

    return-void
.end method

.method public final s(Ljava/lang/Object;Lz5/nd;)V
    .registers 3

    iget-object p2, p0, Lz5/l70;->x:Lz5/k70;

    check-cast p1, Lz5/od;

    .line 1
    iget-object p2, p2, Lz5/k70;->a:Ljava/util/ArrayList;

    invoke-virtual {p2, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method public final u()V
    .registers 17

    move-object/from16 v13, p0

    iget-object v0, v13, Lz5/l70;->x:Lz5/k70;

    .line 1
    iget-object v1, v0, Lz5/k70;->a:Ljava/util/ArrayList;

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

    move-result-object v1

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

    move-result v2

    const/4 v3, 0x0

    if-eqz v2, :cond_62

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

    move-result-object v2

    check-cast v2, Lz5/od;

    .line 2
    iget-object v2, v2, Lz5/od;->g:Ljava/net/HttpURLConnection;

    if-nez v2, :cond_1d

    const/4 v2, 0x0

    goto :goto_21

    :cond_1d
    invoke-virtual {v2}, Ljava/net/HttpURLConnection;->getHeaderFields()Ljava/util/Map;

    move-result-object v2

    :goto_21
    if-eqz v2, :cond_a

    .line 3
    invoke-interface {v2}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v2

    invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :catch_2b
    :cond_2b
    :goto_2b
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_5e

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

    move-result-object v4

    check-cast v4, Ljava/util/Map$Entry;

    :try_start_37
    const-string v5, "content-length"

    invoke-interface {v4}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/lang/String;

    invoke-virtual {v5, v6}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_2b

    invoke-interface {v4}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/util/List;

    invoke-interface {v4, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/String;

    invoke-static {v4}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v4

    iget-wide v6, v0, Lz5/k70;->b:J

    invoke-static {v6, v7, v4, v5}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v4

    iput-wide v4, v0, Lz5/k70;->b:J
    :try_end_5d
    .catch Ljava/lang/RuntimeException; {:try_start_37 .. :try_end_5d} :catch_2b

    goto :goto_2b

    :cond_5e
    invoke-interface {v1}, Ljava/util/Iterator;->remove()V

    goto :goto_a

    :cond_62
    iget-wide v0, v0, Lz5/k70;->b:J

    long-to-int v5, v0

    .line 4
    iget-object v0, v13, Lz5/l70;->y:Lz5/p8;

    iget-object v1, v13, Lz5/l70;->z:Ljava/nio/ByteBuffer;

    invoke-virtual {v0, v1}, Lz5/p8;->a(Ljava/nio/ByteBuffer;)J

    move-result-wide v0

    long-to-int v0, v0

    iget-object v1, v13, Lz5/l70;->z:Ljava/nio/ByteBuffer;

    invoke-virtual {v1}, Ljava/nio/ByteBuffer;->position()I

    move-result v4

    int-to-float v1, v0

    int-to-float v2, v4

    int-to-float v6, v5

    div-float/2addr v2, v6

    mul-float/2addr v2, v1

    invoke-static {v2}, Ljava/lang/Math;->round(F)I

    move-result v1

    if-lez v1, :cond_82

    const/4 v2, 0x1

    move v10, v2

    goto :goto_83

    :cond_82
    move v10, v3

    :goto_83
    invoke-static {}, Lz5/a60;->H()I

    move-result v11

    invoke-static {}, Lz5/a60;->I()I

    move-result v12

    iget-object v2, v13, Lz5/l70;->u:Ljava/lang/String;

    invoke-static {v2}, Lz5/l70;->t(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    int-to-long v6, v1

    int-to-long v8, v0

    .line 5
    sget-object v14, Lz5/z40;->b:Landroid/os/Handler;

    new-instance v15, Lz5/e70;

    move-object v0, v15

    move-object/from16 v1, p0

    invoke-direct/range {v0 .. v12}, Lz5/e70;-><init>(Lcom/google/android/gms/internal/ads/e2;Ljava/lang/String;Ljava/lang/String;IIJJZII)V

    invoke-virtual {v14, v15}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method
