357 lines
7.1 KiB
Smali
357 lines
7.1 KiB
Smali
.class public final Lm5/c;
|
|
.super Ljava/io/FilterInputStream;
|
|
.source "ContentLengthInputStream.java"
|
|
|
|
|
|
# static fields
|
|
.field public static final c:Ljava/lang/String; = "ContentLengthStream"
|
|
|
|
.field public static final d:I = -0x1
|
|
|
|
|
|
# instance fields
|
|
.field public final a:J
|
|
|
|
.field public b:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Ljava/io/InputStream;J)V
|
|
.locals 0
|
|
.param p1 # Ljava/io/InputStream;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
invoke-direct {p0, p1}, Ljava/io/FilterInputStream;-><init>(Ljava/io/InputStream;)V
|
|
|
|
.line 2
|
|
iput-wide p2, p0, Lm5/c;->a:J
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static b(Ljava/io/InputStream;J)Ljava/io/InputStream;
|
|
.locals 1
|
|
.param p0 # Ljava/io/InputStream;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.line 1
|
|
new-instance v0, Lm5/c;
|
|
|
|
invoke-direct {v0, p0, p1, p2}, Lm5/c;-><init>(Ljava/io/InputStream;J)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static c(Ljava/io/InputStream;Ljava/lang/String;)Ljava/io/InputStream;
|
|
.locals 2
|
|
.param p0 # Ljava/io/InputStream;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-static {p1}, Lm5/c;->d(Ljava/lang/String;)I
|
|
|
|
move-result p1
|
|
|
|
int-to-long v0, p1
|
|
|
|
invoke-static {p0, v0, v1}, Lm5/c;->b(Ljava/io/InputStream;J)Ljava/io/InputStream;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static d(Ljava/lang/String;)I
|
|
.locals 4
|
|
.param p0 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 2
|
|
:try_start_0
|
|
invoke-static {p0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
|
|
|
|
move-result p0
|
|
:try_end_0
|
|
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
const/4 v1, 0x3
|
|
|
|
const-string v2, "ContentLengthStream"
|
|
|
|
.line 3
|
|
invoke-static {v2, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 4
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v3, "failed to parse content length header: "
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {v2, p0, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
:cond_0
|
|
const/4 p0, -0x1
|
|
|
|
:goto_0
|
|
return p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final a(I)I
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
if-ltz p1, :cond_0
|
|
|
|
.line 1
|
|
iget v0, p0, Lm5/c;->b:I
|
|
|
|
add-int/2addr v0, p1
|
|
|
|
iput v0, p0, Lm5/c;->b:I
|
|
|
|
goto :goto_0
|
|
|
|
.line 2
|
|
:cond_0
|
|
iget-wide v0, p0, Lm5/c;->a:J
|
|
|
|
iget v2, p0, Lm5/c;->b:I
|
|
|
|
int-to-long v2, v2
|
|
|
|
sub-long/2addr v0, v2
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long v0, v0, v2
|
|
|
|
if-gtz v0, :cond_1
|
|
|
|
:goto_0
|
|
return p1
|
|
|
|
.line 3
|
|
:cond_1
|
|
new-instance p1, Ljava/io/IOException;
|
|
|
|
const-string v0, "Failed to read all expected data, expected: "
|
|
|
|
invoke-static {v0}, Landroid/support/v4/media/d;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
iget-wide v1, p0, Lm5/c;->a:J
|
|
|
|
invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, ", but read: "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget v1, p0, Lm5/c;->b:I
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p1, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized available()I
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
iget-wide v0, p0, Lm5/c;->a:J
|
|
|
|
iget v2, p0, Lm5/c;->b:I
|
|
|
|
int-to-long v2, v2
|
|
|
|
sub-long/2addr v0, v2
|
|
|
|
iget-object v2, p0, Ljava/io/FilterInputStream;->in:Ljava/io/InputStream;
|
|
|
|
invoke-virtual {v2}, Ljava/io/InputStream;->available()I
|
|
|
|
move-result v2
|
|
|
|
int-to-long v2, v2
|
|
|
|
invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->max(JJ)J
|
|
|
|
move-result-wide v0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
long-to-int v0, v0
|
|
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public declared-synchronized read()I
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
invoke-super {p0}, Ljava/io/FilterInputStream;->read()I
|
|
|
|
move-result v0
|
|
|
|
if-ltz v0, :cond_0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v1, -0x1
|
|
|
|
.line 2
|
|
:goto_0
|
|
invoke-virtual {p0, v1}, Lm5/c;->a(I)I
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 3
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public read([B)I
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 4
|
|
array-length v0, p1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {p0, p1, v1, v0}, Lm5/c;->read([BII)I
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public declared-synchronized read([BII)I
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
.line 5
|
|
:try_start_0
|
|
invoke-super {p0, p1, p2, p3}, Ljava/io/FilterInputStream;->read([BII)I
|
|
|
|
move-result p1
|
|
|
|
invoke-virtual {p0, p1}, Lm5/c;->a(I)I
|
|
|
|
move-result p1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return p1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|