.class public final Lz5/yr1;
.super Lz5/a3;
.source ""


# instance fields
.field public v:Lz5/a8;

.field public w:[B

.field public x:I

.field public y:I


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

    const/4 v0, 0x0

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

    return-void
.end method


# virtual methods
.method public final a([BII)I
    .registers 6

    if-nez p3, :cond_4

    const/4 p1, 0x0

    return p1

    :cond_4
    iget v0, p0, Lz5/yr1;->y:I

    if-nez v0, :cond_a

    const/4 p1, -0x1

    return p1

    :cond_a
    invoke-static {p3, v0}, Ljava/lang/Math;->min(II)I

    move-result p3

    iget-object v0, p0, Lz5/yr1;->w:[B

    sget v1, Lz5/r7;->a:I

    iget v1, p0, Lz5/yr1;->x:I

    invoke-static {v0, v1, p1, p2, p3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    iget p1, p0, Lz5/yr1;->x:I

    add-int/2addr p1, p3

    iput p1, p0, Lz5/yr1;->x:I

    iget p1, p0, Lz5/yr1;->y:I

    sub-int/2addr p1, p3

    iput p1, p0, Lz5/yr1;->y:I

    invoke-virtual {p0, p3}, Lz5/a3;->m(I)V

    return p3
.end method

.method public final h(Lz5/a8;)J
    .registers 9

    invoke-virtual {p0, p1}, Lz5/a3;->c(Lz5/a8;)V

    iput-object p1, p0, Lz5/yr1;->v:Lz5/a8;

    iget-object v0, p1, Lz5/a8;->a:Landroid/net/Uri;

    invoke-virtual {v0}, Landroid/net/Uri;->getScheme()Ljava/lang/String;

    move-result-object v1

    const-string v2, "data"

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

    move-result v2

    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 v3

    const-string v4, "Unsupported scheme: "

    if-eqz v3, :cond_22

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

    move-result-object v1

    goto :goto_27

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

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

    :goto_27
    invoke-static {v2, v1}, Lcom/google/android/gms/internal/ads/d;->h(ZLjava/lang/Object;)V

    invoke-virtual {v0}, Landroid/net/Uri;->getSchemeSpecificPart()Ljava/lang/String;

    move-result-object v1

    sget v2, Lz5/r7;->a:I

    const/4 v2, -0x1

    const-string v3, ","

    .line 1
    invoke-virtual {v1, v3, v2}, Ljava/lang/String;->split(Ljava/lang/String;I)[Ljava/lang/String;

    move-result-object v1

    .line 2
    array-length v2, v1

    const/4 v3, 0x2

    const/4 v4, 0x0

    const/4 v5, 0x1

    const/4 v6, 0x0

    if-ne v2, v3, :cond_b6

    aget-object v0, v1, v5

    aget-object v1, v1, v6

    const-string v2, ";base64"

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

    move-result v1

    if-eqz v1, :cond_6e

    :try_start_4a
    invoke-static {v0, v6}, Landroid/util/Base64;->decode(Ljava/lang/String;I)[B

    move-result-object v1

    iput-object v1, p0, Lz5/yr1;->w:[B
    :try_end_50
    .catch Ljava/lang/IllegalArgumentException; {:try_start_4a .. :try_end_50} :catch_51

    goto :goto_7e

    :catch_51
    move-exception p1

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

    move-result-object v0

    const-string v1, "Error while parsing Base64 encoded string: "

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

    move-result v2

    if-eqz v2, :cond_63

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

    move-result-object v0

    goto :goto_68

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

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

    .line 3
    :goto_68
    new-instance v1, Lz5/r3;

    invoke-direct {v1, v0, p1, v5, v6}, Lz5/r3;-><init>(Ljava/lang/String;Ljava/lang/Throwable;ZI)V

    .line 4
    throw v1

    :cond_6e
    sget-object v1, Lz5/m91;->a:Ljava/nio/charset/Charset;

    invoke-virtual {v1}, Ljava/nio/charset/Charset;->name()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Ljava/net/URLDecoder;->decode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lz5/r7;->r(Ljava/lang/String;)[B

    move-result-object v0

    iput-object v0, p0, Lz5/yr1;->w:[B

    :goto_7e
    iget-wide v0, p1, Lz5/a8;->d:J

    iget-object v2, p0, Lz5/yr1;->w:[B

    array-length v2, v2

    int-to-long v5, v2

    cmp-long v3, v0, v5

    if-gtz v3, :cond_ac

    long-to-int v0, v0

    iput v0, p0, Lz5/yr1;->x:I

    sub-int/2addr v2, v0

    iput v2, p0, Lz5/yr1;->y:I

    iget-wide v0, p1, Lz5/a8;->e:J

    const-wide/16 v3, -0x1

    cmp-long v5, v0, v3

    if-eqz v5, :cond_9e

    int-to-long v5, v2

    invoke-static {v5, v6, v0, v1}, Ljava/lang/Math;->min(JJ)J

    move-result-wide v0

    long-to-int v0, v0

    iput v0, p0, Lz5/yr1;->y:I

    :cond_9e
    invoke-virtual {p0, p1}, Lz5/a3;->i(Lz5/a8;)V

    iget-wide v0, p1, Lz5/a8;->e:J

    cmp-long p1, v0, v3

    if-eqz p1, :cond_a8

    return-wide v0

    :cond_a8
    iget p1, p0, Lz5/yr1;->y:I

    int-to-long v0, p1

    return-wide v0

    :cond_ac
    iput-object v4, p0, Lz5/yr1;->w:[B

    new-instance p1, Lz5/y5;

    const/16 v0, 0x7d8

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

    throw p1

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

    move-result-object p1

    const-string v0, "Unexpected URI format: "

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

    move-result-object p1

    .line 5
    new-instance v0, Lz5/r3;

    invoke-direct {v0, p1, v4, v5, v6}, Lz5/r3;-><init>(Ljava/lang/String;Ljava/lang/Throwable;ZI)V

    .line 6
    throw v0
.end method

.method public final zzi()Landroid/net/Uri;
    .registers 2

    iget-object v0, p0, Lz5/yr1;->v:Lz5/a8;

    if-eqz v0, :cond_7

    iget-object v0, v0, Lz5/a8;->a:Landroid/net/Uri;

    return-object v0

    :cond_7
    const/4 v0, 0x0

    return-object v0
.end method

.method public final zzj()V
    .registers 3

    iget-object v0, p0, Lz5/yr1;->w:[B

    const/4 v1, 0x0

    if-eqz v0, :cond_a

    iput-object v1, p0, Lz5/yr1;->w:[B

    invoke-virtual {p0}, Lz5/a3;->n()V

    :cond_a
    iput-object v1, p0, Lz5/yr1;->v:Lz5/a8;

    return-void
.end method
