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


# static fields
.field public static final w:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field public static final x:Ljava/text/DecimalFormat;


# instance fields
.field public u:Ljava/io/File;

.field public v:Z


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

    new-instance v0, Ljava/util/HashSet;

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

    invoke-static {v0}, Ljava/util/Collections;->synchronizedSet(Ljava/util/Set;)Ljava/util/Set;

    move-result-object v0

    sput-object v0, Lz5/i70;->w:Ljava/util/Set;

    new-instance v0, Ljava/text/DecimalFormat;

    const-string v1, "#,###"

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

    sput-object v0, Lz5/i70;->x:Ljava/text/DecimalFormat;

    return-void
.end method

.method public constructor <init>(Lz5/h60;)V
    .registers 5

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

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

    invoke-virtual {p1}, Landroid/content/Context;->getCacheDir()Ljava/io/File;

    move-result-object p1

    if-nez p1, :cond_11

    const-string p1, "Context.getCacheDir() returned null"

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

    return-void

    :cond_11
    new-instance v0, Ljava/io/File;

    const-string v1, "admobVideoStreams"

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

    iput-object v0, p0, Lz5/i70;->u:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->isDirectory()Z

    move-result p1

    const/4 v0, 0x0

    if-nez p1, :cond_4b

    iget-object p1, p0, Lz5/i70;->u:Ljava/io/File;

    invoke-virtual {p1}, Ljava/io/File;->mkdirs()Z

    move-result p1

    if-nez p1, :cond_4b

    iget-object p1, p0, Lz5/i70;->u:Ljava/io/File;

    invoke-virtual {p1}, Ljava/io/File;->getAbsolutePath()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 v1, "Could not create preload cache directory at "

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

    move-result v2

    if-eqz v2, :cond_40

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

    move-result-object p1

    goto :goto_45

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

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

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

    iput-object v0, p0, Lz5/i70;->u:Ljava/io/File;

    return-void

    :cond_4b
    iget-object p1, p0, Lz5/i70;->u:Ljava/io/File;

    const/4 v1, 0x1

    const/4 v2, 0x0

    invoke-virtual {p1, v1, v2}, Ljava/io/File;->setReadable(ZZ)Z

    move-result p1

    if-eqz p1, :cond_5f

    iget-object p1, p0, Lz5/i70;->u:Ljava/io/File;

    invoke-virtual {p1, v1, v2}, Ljava/io/File;->setExecutable(ZZ)Z

    move-result p1

    if-nez p1, :cond_5e

    goto :goto_5f

    :cond_5e
    return-void

    :cond_5f
    :goto_5f
    iget-object p1, p0, Lz5/i70;->u:Ljava/io/File;

    invoke-virtual {p1}, Ljava/io/File;->getAbsolutePath()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 v1, "Could not set cache file permissions at "

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

    move-result v2

    if-eqz v2, :cond_76

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

    move-result-object p1

    goto :goto_7b

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

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

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

    iput-object v0, p0, Lz5/i70;->u:Ljava/io/File;

    return-void
.end method


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

    move-object/from16 v7, p0

    move-object/from16 v8, p1

    iget-object v0, v7, Lz5/i70;->u:Ljava/io/File;

    const/4 v9, 0x0

    const/4 v10, 0x0

    if-eqz v0, :cond_4c6

    :cond_a
    iget-object v0, v7, Lz5/i70;->u:Ljava/io/File;

    if-nez v0, :cond_10

    move v3, v9

    goto :goto_2c

    :cond_10
    invoke-virtual {v0}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object v0

    array-length v1, v0

    move v2, v9

    move v3, v2

    :goto_17
    if-ge v2, v1, :cond_2c

    aget-object v4, v0, v2

    invoke-virtual {v4}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, ".done"

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

    move-result v4

    if-nez v4, :cond_29

    add-int/lit8 v3, v3, 0x1

    :cond_29
    add-int/lit8 v2, v2, 0x1

    goto :goto_17

    :cond_2c
    :goto_2c
    sget-object v0, Lz5/so;->m:Lz5/no;

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

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

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

    move-result-object v0

    check-cast v0, Ljava/lang/Integer;

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v0

    if-le v3, v0, :cond_90

    iget-object v0, v7, Lz5/i70;->u:Ljava/io/File;

    if-nez v0, :cond_43

    goto :goto_85

    :cond_43
    invoke-virtual {v0}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object v0

    array-length v1, v0

    const-wide v2, 0x7fffffffffffffffL

    move v4, v9

    move-object v5, v10

    :goto_4f
    if-ge v4, v1, :cond_6c

    aget-object v6, v0, v4

    invoke-virtual {v6}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v11

    const-string v12, ".done"

    invoke-virtual {v11, v12}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v11

    if-nez v11, :cond_69

    invoke-virtual {v6}, Ljava/io/File;->lastModified()J

    move-result-wide v11

    cmp-long v13, v11, v2

    if-gez v13, :cond_69

    move-object v5, v6

    move-wide v2, v11

    :cond_69
    add-int/lit8 v4, v4, 0x1

    goto :goto_4f

    :cond_6c
    if-eqz v5, :cond_82

    invoke-virtual {v5}, Ljava/io/File;->delete()Z

    move-result v0

    invoke-virtual {v7, v5}, Lz5/i70;->t(Ljava/io/File;)Ljava/io/File;

    move-result-object v1

    invoke-virtual {v1}, Ljava/io/File;->isFile()Z

    move-result v2

    if-eqz v2, :cond_83

    invoke-virtual {v1}, Ljava/io/File;->delete()Z

    move-result v1

    and-int/2addr v0, v1

    goto :goto_83

    :cond_82
    move v0, v9

    :cond_83
    :goto_83
    if-nez v0, :cond_a

    :goto_85
    const-string v0, "Unable to expire stream cache"

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

    const-string v0, "expireFailed"

    invoke-virtual {v7, v8, v10, v0, v10}, Lcom/google/android/gms/internal/ads/e2;->q(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    return v9

    :cond_90
    invoke-static/range {p1 .. p1}, Lz5/z40;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    new-instance v11, Ljava/io/File;

    iget-object v2, v7, Lz5/i70;->u:Ljava/io/File;

    invoke-direct {v11, v2, v0}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    invoke-virtual {v7, v11}, Lz5/i70;->t(Ljava/io/File;)Ljava/io/File;

    move-result-object v0

    invoke-virtual {v11}, Ljava/io/File;->isFile()Z

    move-result v2

    const/4 v12, 0x1

    if-eqz v2, :cond_d9

    invoke-virtual {v0}, Ljava/io/File;->isFile()Z

    move-result v2

    if-eqz v2, :cond_d9

    invoke-virtual {v11}, Ljava/io/File;->length()J

    move-result-wide v0

    long-to-int v0, v0

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

    move-result-object v1

    const-string v2, "Stream cache hit at "

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

    move-result v3

    if-eqz v3, :cond_c2

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

    move-result-object v1

    goto :goto_c7

    :cond_c2
    new-instance v1, Ljava/lang/String;

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

    :goto_c7
    invoke-static {v1}, Lz5/d50;->zzd(Ljava/lang/String;)V

    invoke-virtual {v11}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v1

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

    new-instance v3, Lz5/f70;

    invoke-direct {v3, v7, v8, v1, v0}, Lz5/f70;-><init>(Lcom/google/android/gms/internal/ads/e2;Ljava/lang/String;Ljava/lang/String;I)V

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

    return v12

    .line 4
    :cond_d9
    iget-object v2, v7, Lz5/i70;->u:Ljava/io/File;

    invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v2

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

    move-result-object v2

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

    move-result-object v3

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

    move-result v4

    if-eqz v4, :cond_f3

    invoke-virtual {v2, v3}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    move-object v13, v2

    goto :goto_f9

    :cond_f3
    new-instance v3, Ljava/lang/String;

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

    move-object v13, v3

    :goto_f9
    sget-object v2, Lz5/i70;->w:Ljava/util/Set;

    monitor-enter v2

    :try_start_fc
    invoke-interface {v2, v13}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_127

    const-string v0, "Stream cache already in progress at "

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

    move-result-object v1

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

    move-result v3

    if-eqz v3, :cond_113

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

    move-result-object v0

    goto :goto_119

    :cond_113
    new-instance v1, Ljava/lang/String;

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

    move-object v0, v1

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

    invoke-virtual {v11}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

    const-string v1, "inProgress"

    invoke-virtual {v7, v8, v0, v1, v10}, Lcom/google/android/gms/internal/ads/e2;->q(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    monitor-exit v2

    return v9

    :cond_127
    invoke-interface {v2, v13}, Ljava/util/Set;->add(Ljava/lang/Object;)Z

    monitor-exit v2
    :try_end_12b
    .catchall {:try_start_fc .. :try_end_12b} :catchall_4c3

    const-string v14, "error"

    .line 5
    :try_start_12d
    new-instance v3, Lz5/g91;

    invoke-direct {v3}, Lz5/g91;-><init>()V

    .line 6
    new-instance v4, Lz5/u30;

    const/4 v5, 0x2

    invoke-direct {v4, v8, v5}, Lz5/u30;-><init>(Ljava/lang/String;I)V

    const/16 v5, 0x109

    invoke-virtual {v3, v4, v5}, Lz5/g91;->b(Lz5/u30;I)Ljava/net/HttpURLConnection;

    move-result-object v3

    invoke-virtual {v3}, Ljava/net/HttpURLConnection;->getResponseCode()I

    move-result v4

    const/16 v5, 0x190

    if-lt v4, v5, :cond_198

    const-string v14, "badUrl"
    :try_end_148
    .catch Ljava/io/IOException; {:try_start_12d .. :try_end_148} :catch_424
    .catch Ljava/lang/RuntimeException; {:try_start_12d .. :try_end_148} :catch_420

    :try_start_148
    const-string v0, "HTTP request failed. Code: "

    invoke-static {v4}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v1

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

    move-result-object v1

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

    move-result v2

    if-eqz v2, :cond_15e

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

    move-result-object v0

    move-object v1, v0

    goto :goto_163

    :cond_15e
    new-instance v1, Ljava/lang/String;

    invoke-direct {v1, v0}, Ljava/lang/String;-><init>(Ljava/lang/String;)V
    :try_end_163
    .catch Ljava/io/IOException; {:try_start_148 .. :try_end_163} :catch_194
    .catch Ljava/lang/RuntimeException; {:try_start_148 .. :try_end_163} :catch_192

    :goto_163
    :try_start_163
    new-instance v0, Ljava/io/IOException;

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

    move-result-object v2

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

    move-result v2

    add-int/lit8 v2, v2, 0x20

    new-instance v3, Ljava/lang/StringBuilder;

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

    const-string v2, "HTTP status code "

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

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

    const-string v2, " at "

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

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

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

    move-result-object v2

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

    throw v0
    :try_end_18c
    .catch Ljava/io/IOException; {:try_start_163 .. :try_end_18c} :catch_18f
    .catch Ljava/lang/RuntimeException; {:try_start_163 .. :try_end_18c} :catch_18c

    :catch_18c
    move-exception v0

    goto/16 :goto_42a

    :catch_18f
    move-exception v0

    goto/16 :goto_42a

    :catch_192
    move-exception v0

    goto :goto_195

    :catch_194
    move-exception v0

    :goto_195
    move-object v1, v10

    goto/16 :goto_42a

    :cond_198
    :try_start_198
    invoke-virtual {v3}, Ljava/net/URLConnection;->getContentLength()I

    move-result v15

    if-gez v15, :cond_1c5

    const-string v0, "Stream cache aborted, missing content-length header at "

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

    move-result-object v1

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

    move-result v3

    if-eqz v3, :cond_1af

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

    move-result-object v0

    goto :goto_1b5

    :cond_1af
    new-instance v1, Ljava/lang/String;

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

    move-object v0, v1

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

    invoke-virtual {v11}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

    const-string v1, "contentLengthMissing"

    invoke-virtual {v7, v8, v0, v1, v10}, Lcom/google/android/gms/internal/ads/e2;->q(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v2, v13}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z

    return v9

    :cond_1c5
    sget-object v4, Lz5/i70;->x:Ljava/text/DecimalFormat;

    int-to-long v5, v15

    invoke-virtual {v4, v5, v6}, Ljava/text/DecimalFormat;->format(J)Ljava/lang/String;

    move-result-object v4

    sget-object v5, Lz5/so;->n:Lz5/no;

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

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

    move-result-object v5

    check-cast v5, Ljava/lang/Integer;

    invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I

    move-result v6

    if-le v15, v6, :cond_22f

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

    move-result-object v0

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

    move-result v0

    add-int/lit8 v0, v0, 0x21

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

    move-result-object v1

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

    move-result v1

    add-int/2addr v0, v1

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v0, "Content length "

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

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

    const-string v0, " exceeds limit at "

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

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

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

    move-result-object v0

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

    const-string v0, "File too big for full file cache. Size: "

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

    move-result-object v1

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

    move-result v3

    if-eqz v3, :cond_21c

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

    move-result-object v0

    goto :goto_222

    :cond_21c
    new-instance v1, Ljava/lang/String;

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

    move-object v0, v1

    :goto_222
    invoke-virtual {v11}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v1

    const-string v3, "sizeExceeded"

    invoke-virtual {v7, v8, v1, v3, v0}, Lcom/google/android/gms/internal/ads/e2;->q(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v2, v13}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z

    return v9

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

    move-result-object v2

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

    move-result v2

    add-int/lit8 v2, v2, 0x14

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

    move-result-object v5

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

    move-result v5

    add-int/2addr v2, v5

    new-instance v5, Ljava/lang/StringBuilder;

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

    const-string v2, "Caching "

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

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

    const-string v2, " bytes from "

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

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

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

    move-result-object v2

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

    invoke-virtual {v3}, Ljava/net/URLConnection;->getInputStream()Ljava/io/InputStream;

    move-result-object v2

    invoke-static {v2}, Ljava/nio/channels/Channels;->newChannel(Ljava/io/InputStream;)Ljava/nio/channels/ReadableByteChannel;

    move-result-object v5

    new-instance v4, Ljava/io/FileOutputStream;

    invoke-direct {v4, v11}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
    :try_end_26b
    .catch Ljava/io/IOException; {:try_start_198 .. :try_end_26b} :catch_424
    .catch Ljava/lang/RuntimeException; {:try_start_198 .. :try_end_26b} :catch_420

    :try_start_26b
    invoke-virtual {v4}, Ljava/io/FileOutputStream;->getChannel()Ljava/nio/channels/FileChannel;

    move-result-object v3

    const/high16 v2, 0x100000

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

    move-result-object v2

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

    move-result-object v16

    invoke-interface/range {v16 .. v16}, Lu5/c;->b()J

    move-result-wide v17

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

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

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

    move-result-object v9

    check-cast v9, Ljava/lang/Long;

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

    move-result-wide v9

    new-instance v12, Lcom/google/android/gms/ads/internal/util/zzcc;

    invoke-direct {v12, v9, v10}, Lcom/google/android/gms/ads/internal/util/zzcc;-><init>(J)V

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

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

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

    move-result-object v1

    check-cast v1, Ljava/lang/Long;

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

    move-result-wide v9

    const/4 v1, 0x0

    :goto_29f
    invoke-interface {v5, v2}, Ljava/nio/channels/ReadableByteChannel;->read(Ljava/nio/ByteBuffer;)I

    move-result v19

    if-ltz v19, :cond_39f

    add-int v1, v1, v19

    if-le v1, v6, :cond_2dd

    const-string v14, "sizeExceeded"
    :try_end_2ab
    .catch Ljava/io/IOException; {:try_start_26b .. :try_end_2ab} :catch_418
    .catch Ljava/lang/RuntimeException; {:try_start_26b .. :try_end_2ab} :catch_412

    :try_start_2ab
    const-string v0, "File too big for full file cache. Size: "

    invoke-static {v1}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v1

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

    move-result-object v1

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

    move-result v2

    if-eqz v2, :cond_2c1

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

    move-result-object v0

    move-object v10, v0

    goto :goto_2c7

    :cond_2c1
    new-instance v1, Ljava/lang/String;

    invoke-direct {v1, v0}, Ljava/lang/String;-><init>(Ljava/lang/String;)V
    :try_end_2c6
    .catch Ljava/io/IOException; {:try_start_2ab .. :try_end_2c6} :catch_2d8
    .catch Ljava/lang/RuntimeException; {:try_start_2ab .. :try_end_2c6} :catch_2d6

    move-object v10, v1

    :goto_2c7
    :try_start_2c7
    new-instance v0, Ljava/io/IOException;

    const-string v1, "stream cache file size limit exceeded"

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

    throw v0
    :try_end_2cf
    .catch Ljava/io/IOException; {:try_start_2c7 .. :try_end_2cf} :catch_2d1
    .catch Ljava/lang/RuntimeException; {:try_start_2c7 .. :try_end_2cf} :catch_2cf

    :catch_2cf
    move-exception v0

    goto :goto_2d2

    :catch_2d1
    move-exception v0

    :goto_2d2
    move-object v1, v10

    move-object v10, v4

    goto/16 :goto_42a

    :catch_2d6
    move-exception v0

    goto :goto_2d9

    :catch_2d8
    move-exception v0

    :goto_2d9
    move-object/from16 v25, v4

    goto/16 :goto_41c

    :cond_2dd
    :try_start_2dd
    invoke-virtual {v2}, Ljava/nio/ByteBuffer;->flip()Ljava/nio/Buffer;

    :cond_2e0
    invoke-virtual {v3, v2}, Ljava/nio/channels/FileChannel;->write(Ljava/nio/ByteBuffer;)I

    move-result v19

    if-gtz v19, :cond_2e0

    invoke-virtual {v2}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;

    invoke-interface/range {v16 .. v16}, Lu5/c;->b()J

    move-result-wide v19

    sub-long v19, v19, v17

    const-wide/16 v21, 0x3e8

    mul-long v21, v21, v9

    cmp-long v19, v19, v21

    if-gtz v19, :cond_35f

    move/from16 v19, v1

    iget-boolean v1, v7, Lz5/i70;->v:Z

    if-nez v1, :cond_34b

    invoke-virtual {v12}, Lcom/google/android/gms/ads/internal/util/zzcc;->zza()Z

    move-result v1

    if-eqz v1, :cond_32b

    invoke-virtual {v11}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v20

    sget-object v1, Lz5/z40;->b:Landroid/os/Handler;

    move-object/from16 v21, v12

    new-instance v12, Lz5/c70;
    :try_end_30d
    .catch Ljava/io/IOException; {:try_start_2dd .. :try_end_30d} :catch_418
    .catch Ljava/lang/RuntimeException; {:try_start_2dd .. :try_end_30d} :catch_412

    move-object/from16 v22, v14

    move-object v14, v1

    move-object v1, v12

    move-object/from16 v23, v2

    move-object/from16 v2, p0

    move-object/from16 v24, v3

    move-object/from16 v3, p1

    move-object/from16 v25, v4

    move-object/from16 v4, v20

    move-object/from16 v20, v5

    move/from16 v5, v19

    move/from16 v26, v6

    move v6, v15

    :try_start_324
    invoke-direct/range {v1 .. v6}, Lz5/c70;-><init>(Lcom/google/android/gms/internal/ads/e2;Ljava/lang/String;Ljava/lang/String;II)V

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

    goto :goto_339

    :cond_32b
    move-object/from16 v23, v2

    move-object/from16 v24, v3

    move-object/from16 v25, v4

    move-object/from16 v20, v5

    move/from16 v26, v6

    move-object/from16 v21, v12

    move-object/from16 v22, v14

    :goto_339
    move/from16 v1, v19

    move-object/from16 v5, v20

    move-object/from16 v12, v21

    move-object/from16 v14, v22

    move-object/from16 v2, v23

    move-object/from16 v3, v24

    move-object/from16 v4, v25

    move/from16 v6, v26

    goto/16 :goto_29f

    :cond_34b
    move-object/from16 v25, v4

    move-object/from16 v22, v14

    const-string v1, "externalAbort"
    :try_end_351
    .catch Ljava/io/IOException; {:try_start_324 .. :try_end_351} :catch_410
    .catch Ljava/lang/RuntimeException; {:try_start_324 .. :try_end_351} :catch_40e

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

    const-string v2, "abort requested"

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

    throw v0
    :try_end_359
    .catch Ljava/io/IOException; {:try_start_351 .. :try_end_359} :catch_35d
    .catch Ljava/lang/RuntimeException; {:try_start_351 .. :try_end_359} :catch_359

    :catch_359
    move-exception v0

    :goto_35a
    move-object v14, v1

    goto/16 :goto_41c

    :catch_35d
    move-exception v0

    goto :goto_35a

    :cond_35f
    move-object/from16 v25, v4

    move-object/from16 v22, v14

    :try_start_363
    const-string v14, "downloadTimeout"
    :try_end_365
    .catch Ljava/io/IOException; {:try_start_363 .. :try_end_365} :catch_410
    .catch Ljava/lang/RuntimeException; {:try_start_363 .. :try_end_365} :catch_40e

    :try_start_365
    invoke-static {v9, v10}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v0

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

    move-result-object v1

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

    move-result v1

    add-int/lit8 v1, v1, 0x1d

    new-instance v2, Ljava/lang/StringBuilder;

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

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

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

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

    const-string v0, " sec"

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

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

    move-result-object v10
    :try_end_389
    .catch Ljava/io/IOException; {:try_start_365 .. :try_end_389} :catch_39c
    .catch Ljava/lang/RuntimeException; {:try_start_365 .. :try_end_389} :catch_399

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

    const-string v1, "stream cache time limit exceeded"

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

    throw v0
    :try_end_391
    .catch Ljava/io/IOException; {:try_start_389 .. :try_end_391} :catch_393
    .catch Ljava/lang/RuntimeException; {:try_start_389 .. :try_end_391} :catch_391

    :catch_391
    move-exception v0

    goto :goto_394

    :catch_393
    move-exception v0

    :goto_394
    move-object v1, v10

    move-object/from16 v10, v25

    goto/16 :goto_42a

    :catch_399
    move-exception v0

    goto/16 :goto_41c

    :catch_39c
    move-exception v0

    goto/16 :goto_41c

    :cond_39f
    move-object/from16 v25, v4

    move-object/from16 v22, v14

    :try_start_3a3
    invoke-virtual/range {v25 .. v25}, Ljava/io/FileOutputStream;->close()V

    const/4 v2, 0x3

    invoke-static {v2}, Lz5/d50;->zzm(I)Z

    move-result v2

    if-eqz v2, :cond_3e3

    sget-object v2, Lz5/i70;->x:Ljava/text/DecimalFormat;

    int-to-long v3, v1

    invoke-virtual {v2, v3, v4}, Ljava/text/DecimalFormat;->format(J)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, 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

    add-int/lit8 v3, v3, 0x16

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

    move-result-object v4

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

    move-result v4

    add-int/2addr v3, v4

    new-instance v4, Ljava/lang/StringBuilder;

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

    const-string v3, "Preloaded "

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

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

    const-string v2, " bytes from "

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

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

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

    move-result-object v2

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

    :cond_3e3
    const/4 v2, 0x0

    const/4 v3, 0x1

    invoke-virtual {v11, v3, v2}, Ljava/io/File;->setReadable(ZZ)Z

    invoke-virtual {v0}, Ljava/io/File;->isFile()Z

    move-result v2

    if-eqz v2, :cond_3f6

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    invoke-virtual {v0, v2, v3}, Ljava/io/File;->setLastModified(J)Z
    :try_end_3f5
    .catch Ljava/io/IOException; {:try_start_3a3 .. :try_end_3f5} :catch_410
    .catch Ljava/lang/RuntimeException; {:try_start_3a3 .. :try_end_3f5} :catch_40e

    goto :goto_3f9

    :cond_3f6
    :try_start_3f6
    invoke-virtual {v0}, Ljava/io/File;->createNewFile()Z
    :try_end_3f9
    .catch Ljava/io/IOException; {:try_start_3f6 .. :try_end_3f9} :catch_3f9
    .catch Ljava/lang/RuntimeException; {:try_start_3f6 .. :try_end_3f9} :catch_40e

    :catch_3f9
    :goto_3f9
    :try_start_3f9
    invoke-virtual {v11}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

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

    new-instance v3, Lz5/f70;

    invoke-direct {v3, v7, v8, v0, v1}, Lz5/f70;-><init>(Lcom/google/android/gms/internal/ads/e2;Ljava/lang/String;Ljava/lang/String;I)V

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

    .line 14
    sget-object v0, Lz5/i70;->w:Ljava/util/Set;

    invoke-interface {v0, v13}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
    :try_end_40c
    .catch Ljava/io/IOException; {:try_start_3f9 .. :try_end_40c} :catch_410
    .catch Ljava/lang/RuntimeException; {:try_start_3f9 .. :try_end_40c} :catch_40e

    const/4 v0, 0x1

    return v0

    :catch_40e
    move-exception v0

    goto :goto_41a

    :catch_410
    move-exception v0

    goto :goto_41a

    :catch_412
    move-exception v0

    :goto_413
    move-object/from16 v25, v4

    move-object/from16 v22, v14

    goto :goto_41a

    :catch_418
    move-exception v0

    goto :goto_413

    :goto_41a
    move-object/from16 v14, v22

    :goto_41c
    move-object/from16 v10, v25

    const/4 v1, 0x0

    goto :goto_42a

    :catch_420
    move-exception v0

    :goto_421
    move-object/from16 v22, v14

    goto :goto_426

    :catch_424
    move-exception v0

    goto :goto_421

    :goto_426
    move-object/from16 v14, v22

    const/4 v1, 0x0

    const/4 v10, 0x0

    :goto_42a
    instance-of v2, v0, Ljava/lang/RuntimeException;

    if-eqz v2, :cond_43f

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

    move-result-object v2

    const-string v3, "VideoStreamFullFileCache.preload"

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

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

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

    move-result-object v2

    invoke-interface {v2, v0, v3}, Lz5/f10;->a(Ljava/lang/Throwable;Ljava/lang/String;)V

    .line 16
    :cond_43f
    :try_start_43f
    invoke-virtual {v10}, Ljava/io/FileOutputStream;->close()V
    :try_end_442
    .catch Ljava/io/IOException; {:try_start_43f .. :try_end_442} :catch_442
    .catch Ljava/lang/NullPointerException; {:try_start_43f .. :try_end_442} :catch_442

    :catch_442
    iget-boolean v2, v7, Lz5/i70;->v:Z

    if-eqz v2, :cond_46a

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

    move-result-object v0

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

    move-result v0

    new-instance v2, Ljava/lang/StringBuilder;

    add-int/lit8 v0, v0, 0x1a

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

    const-string v0, "Preload aborted for URL \""

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

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

    const-string v0, "\""

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

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

    move-result-object v0

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

    goto :goto_48d

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

    move-result-object v2

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

    move-result v2

    new-instance v3, Ljava/lang/StringBuilder;

    add-int/lit8 v2, v2, 0x19

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

    const-string v2, "Preload failed for URL \""

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

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

    const-string v2, "\""

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

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

    move-result-object v2

    invoke-static {v2, v0}, Lz5/d50;->zzj(Ljava/lang/String;Ljava/lang/Throwable;)V

    :goto_48d
    invoke-virtual {v11}, Ljava/io/File;->exists()Z

    move-result v0

    if-eqz v0, :cond_4b6

    invoke-virtual {v11}, Ljava/io/File;->delete()Z

    move-result v0

    if-nez v0, :cond_4b6

    invoke-virtual {v11}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

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

    move-result-object v0

    const-string v2, "Could not delete partial cache file at "

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

    move-result v3

    if-eqz v3, :cond_4ae

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

    move-result-object v0

    goto :goto_4b3

    :cond_4ae
    new-instance v0, Ljava/lang/String;

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

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

    :cond_4b6
    invoke-virtual {v11}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v7, v8, v0, v14, v1}, Lcom/google/android/gms/internal/ads/e2;->q(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    sget-object v0, Lz5/i70;->w:Ljava/util/Set;

    invoke-interface {v0, v13}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z

    goto :goto_4cc

    :catchall_4c3
    move-exception v0

    :try_start_4c4
    monitor-exit v2
    :try_end_4c5
    .catchall {:try_start_4c4 .. :try_end_4c5} :catchall_4c3

    throw v0

    :cond_4c6
    const-string v0, "noCacheDir"

    const/4 v1, 0x0

    invoke-virtual {v7, v8, v1, v0, v1}, Lcom/google/android/gms/internal/ads/e2;->q(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    :goto_4cc
    const/4 v1, 0x0

    return v1
.end method

.method public final m()V
    .registers 2

    const/4 v0, 0x1

    iput-boolean v0, p0, Lz5/i70;->v:Z

    return-void
.end method

.method public final t(Ljava/io/File;)Ljava/io/File;
    .registers 5

    new-instance v0, Ljava/io/File;

    iget-object v1, p0, Lz5/i70;->u:Ljava/io/File;

    invoke-virtual {p1}, Ljava/io/File;->getName()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 v2, ".done"

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

    move-result-object p1

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

    return-object v0
.end method
