Rabbit-R1/switch port/smali/smali_classes3/okhttp3/MultipartReader.smali

697 lines
18 KiB
Smali
Raw Normal View History

2024-05-21 16:08:36 -05:00
.class public final Lokhttp3/MultipartReader;
.super Ljava/lang/Object;
.source "MultipartReader.kt"
# interfaces
.implements Ljava/io/Closeable;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lokhttp3/MultipartReader$PartSource;,
Lokhttp3/MultipartReader$Part;,
Lokhttp3/MultipartReader$Companion;
}
.end annotation
.annotation system Ldalvik/annotation/SourceDebugExtension;
value = "SMAP\nMultipartReader.kt\nKotlin\n*S Kotlin\n*F\n+ 1 MultipartReader.kt\nokhttp3/MultipartReader\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,210:1\n1#2:211\n*E\n"
.end annotation
.annotation runtime Lkotlin/Metadata;
bv = {
0x1,
0x0,
0x3
}
d1 = {
"\u0000P\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\u0008\u0003\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0003\n\u0002\u0010\u0008\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0004\u0018\u0000 \u001c2\u00020\u0001:\u0003\u001c\u001d\u001eB\u000f\u0008\u0016\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u00a2\u0006\u0002\u0010\u0004B\u0015\u0012\u0006\u0010\u0005\u001a\u00020\u0006\u0012\u0006\u0010\u0007\u001a\u00020\u0008\u00a2\u0006\u0002\u0010\tJ\u0008\u0010\u0015\u001a\u00020\u0016H\u0016J\u0010\u0010\u0017\u001a\u00020\u00182\u0006\u0010\u0019\u001a\u00020\u0018H\u0002J\u0008\u0010\u001a\u001a\u0004\u0018\u00010\u001bR\u0013\u0010\u0007\u001a\u00020\u00088\u0007\u00a2\u0006\u0008\n\u0000\u001a\u0004\u0008\u0007\u0010\nR\u000e\u0010\u000b\u001a\u00020\u000cX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u000eX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u000f\u001a\u0008\u0018\u00010\u0010R\u00020\u0000X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0011\u001a\u00020\u000eX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0012\u001a\u00020\u000cX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0013\u001a\u00020\u0014X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u001f"
}
d2 = {
"Lokhttp3/MultipartReader;",
"Ljava/io/Closeable;",
"response",
"Lokhttp3/ResponseBody;",
"(Lokhttp3/ResponseBody;)V",
"source",
"Lokio/BufferedSource;",
"boundary",
"",
"(Lokio/BufferedSource;Ljava/lang/String;)V",
"()Ljava/lang/String;",
"closed",
"",
"crlfDashDashBoundary",
"Lokio/ByteString;",
"currentPart",
"Lokhttp3/MultipartReader$PartSource;",
"dashDashBoundary",
"noMoreParts",
"partCount",
"",
"close",
"",
"currentPartBytesRemaining",
"",
"maxResult",
"nextPart",
"Lokhttp3/MultipartReader$Part;",
"Companion",
"Part",
"PartSource",
"okhttp"
}
k = 0x1
mv = {
0x1,
0x4,
0x0
}
.end annotation
# static fields
.field public static final Companion:Lokhttp3/MultipartReader$Companion;
.field private static final afterBoundaryOptions:Lokio/Options;
# instance fields
.field private final boundary:Ljava/lang/String;
.field private closed:Z
.field private final crlfDashDashBoundary:Lokio/ByteString;
.field private currentPart:Lokhttp3/MultipartReader$PartSource;
.field private final dashDashBoundary:Lokio/ByteString;
.field private noMoreParts:Z
.field private partCount:I
.field private final source:Lokio/BufferedSource;
# direct methods
.method static constructor <clinit>()V
.locals 4
new-instance v0, Lokhttp3/MultipartReader$Companion;
const/4 v1, 0x0
invoke-direct {v0, v1}, Lokhttp3/MultipartReader$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
sput-object v0, Lokhttp3/MultipartReader;->Companion:Lokhttp3/MultipartReader$Companion;
.line 202
sget-object v0, Lokio/Options;->Companion:Lokio/Options$Companion;
const/4 v1, 0x4
new-array v1, v1, [Lokio/ByteString;
.line 203
sget-object v2, Lokio/ByteString;->Companion:Lokio/ByteString$Companion;
const-string v3, "\r\n"
invoke-virtual {v2, v3}, Lokio/ByteString$Companion;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v2
const/4 v3, 0x0
aput-object v2, v1, v3
.line 204
sget-object v2, Lokio/ByteString;->Companion:Lokio/ByteString$Companion;
const-string v3, "--"
invoke-virtual {v2, v3}, Lokio/ByteString$Companion;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v2
const/4 v3, 0x1
aput-object v2, v1, v3
.line 205
sget-object v2, Lokio/ByteString;->Companion:Lokio/ByteString$Companion;
const-string v3, " "
invoke-virtual {v2, v3}, Lokio/ByteString$Companion;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v2
const/4 v3, 0x2
aput-object v2, v1, v3
.line 206
sget-object v2, Lokio/ByteString;->Companion:Lokio/ByteString$Companion;
const-string v3, "\t"
invoke-virtual {v2, v3}, Lokio/ByteString$Companion;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v2
const/4 v3, 0x3
aput-object v2, v1, v3
.line 202
invoke-virtual {v0, v1}, Lokio/Options$Companion;->of([Lokio/ByteString;)Lokio/Options;
move-result-object v0
sput-object v0, Lokhttp3/MultipartReader;->afterBoundaryOptions:Lokio/Options;
return-void
.end method
.method public constructor <init>(Lokhttp3/ResponseBody;)V
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const-string v0, "response"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 85
invoke-virtual {p1}, Lokhttp3/ResponseBody;->source()Lokio/BufferedSource;
move-result-object v0
.line 86
invoke-virtual {p1}, Lokhttp3/ResponseBody;->contentType()Lokhttp3/MediaType;
move-result-object p1
if-eqz p1, :cond_0
const-string v1, "boundary"
invoke-virtual {p1, v1}, Lokhttp3/MediaType;->parameter(Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
if-eqz p1, :cond_0
.line 84
invoke-direct {p0, v0, p1}, Lokhttp3/MultipartReader;-><init>(Lokio/BufferedSource;Ljava/lang/String;)V
return-void
.line 87
:cond_0
new-instance p0, Ljava/net/ProtocolException;
const-string p1, "expected the Content-Type to have a boundary parameter"
invoke-direct {p0, p1}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
check-cast p0, Ljava/lang/Throwable;
throw p0
.end method
.method public constructor <init>(Lokio/BufferedSource;Ljava/lang/String;)V
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const-string v0, "source"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "boundary"
invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 57
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lokhttp3/MultipartReader;->source:Lokio/BufferedSource;
iput-object p2, p0, Lokhttp3/MultipartReader;->boundary:Ljava/lang/String;
.line 62
new-instance p1, Lokio/Buffer;
invoke-direct {p1}, Lokio/Buffer;-><init>()V
const-string v0, "--"
.line 63
invoke-virtual {p1, v0}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
move-result-object p1
.line 64
invoke-virtual {p1, p2}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
move-result-object p1
.line 65
invoke-virtual {p1}, Lokio/Buffer;->readByteString()Lokio/ByteString;
move-result-object p1
iput-object p1, p0, Lokhttp3/MultipartReader;->dashDashBoundary:Lokio/ByteString;
.line 71
new-instance p1, Lokio/Buffer;
invoke-direct {p1}, Lokio/Buffer;-><init>()V
const-string v0, "\r\n--"
.line 72
invoke-virtual {p1, v0}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
move-result-object p1
.line 73
invoke-virtual {p1, p2}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
move-result-object p1
.line 74
invoke-virtual {p1}, Lokio/Buffer;->readByteString()Lokio/ByteString;
move-result-object p1
iput-object p1, p0, Lokhttp3/MultipartReader;->crlfDashDashBoundary:Lokio/ByteString;
return-void
.end method
.method public static final synthetic access$currentPartBytesRemaining(Lokhttp3/MultipartReader;J)J
.locals 0
.line 57
invoke-direct {p0, p1, p2}, Lokhttp3/MultipartReader;->currentPartBytesRemaining(J)J
move-result-wide p0
return-wide p0
.end method
.method public static final synthetic access$getAfterBoundaryOptions$cp()Lokio/Options;
.locals 1
sget-object v0, Lokhttp3/MultipartReader;->afterBoundaryOptions:Lokio/Options;
return-object v0
.end method
.method public static final synthetic access$getCurrentPart$p(Lokhttp3/MultipartReader;)Lokhttp3/MultipartReader$PartSource;
.locals 0
.line 57
iget-object p0, p0, Lokhttp3/MultipartReader;->currentPart:Lokhttp3/MultipartReader$PartSource;
return-object p0
.end method
.method public static final synthetic access$getSource$p(Lokhttp3/MultipartReader;)Lokio/BufferedSource;
.locals 0
.line 57
iget-object p0, p0, Lokhttp3/MultipartReader;->source:Lokio/BufferedSource;
return-object p0
.end method
.method public static final synthetic access$setCurrentPart$p(Lokhttp3/MultipartReader;Lokhttp3/MultipartReader$PartSource;)V
.locals 0
.line 57
iput-object p1, p0, Lokhttp3/MultipartReader;->currentPart:Lokhttp3/MultipartReader$PartSource;
return-void
.end method
.method private final currentPartBytesRemaining(J)J
.locals 4
iget-object v0, p0, Lokhttp3/MultipartReader;->source:Lokio/BufferedSource;
iget-object v1, p0, Lokhttp3/MultipartReader;->crlfDashDashBoundary:Lokio/ByteString;
.line 178
invoke-virtual {v1}, Lokio/ByteString;->size()I
move-result v1
int-to-long v1, v1
invoke-interface {v0, v1, v2}, Lokio/BufferedSource;->require(J)V
iget-object v0, p0, Lokhttp3/MultipartReader;->source:Lokio/BufferedSource;
.line 180
invoke-interface {v0}, Lokio/BufferedSource;->getBuffer()Lokio/Buffer;
move-result-object v0
iget-object v1, p0, Lokhttp3/MultipartReader;->crlfDashDashBoundary:Lokio/ByteString;
invoke-virtual {v0, v1}, Lokio/Buffer;->indexOf(Lokio/ByteString;)J
move-result-wide v0
const-wide/16 v2, -0x1
cmp-long v2, v0, v2
if-nez v2, :cond_0
iget-object v0, p0, Lokhttp3/MultipartReader;->source:Lokio/BufferedSource;
.line 181
invoke-interface {v0}, Lokio/BufferedSource;->getBuffer()Lokio/Buffer;
move-result-object v0
invoke-virtual {v0}, Lokio/Buffer;->size()J
move-result-wide v0
iget-object p0, p0, Lokhttp3/MultipartReader;->crlfDashDashBoundary:Lokio/ByteString;
invoke-virtual {p0}, Lokio/ByteString;->size()I
move-result p0
int-to-long v2, p0
sub-long/2addr v0, v2
const-wide/16 v2, 0x1
add-long/2addr v0, v2
invoke-static {p1, p2, v0, v1}, Ljava/lang/Math;->min(JJ)J
move-result-wide p0
goto :goto_0
.line 182
:cond_0
invoke-static {p1, p2, v0, v1}, Ljava/lang/Math;->min(JJ)J
move-result-wide p0
:goto_0
return-wide p0
.end method
# virtual methods
.method public final boundary()Ljava/lang/String;
.locals 0
iget-object p0, p0, Lokhttp3/MultipartReader;->boundary:Ljava/lang/String;
return-object p0
.end method
.method public close()V
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
iget-boolean v0, p0, Lokhttp3/MultipartReader;->closed:Z
if-eqz v0, :cond_0
return-void
:cond_0
const/4 v0, 0x1
iput-boolean v0, p0, Lokhttp3/MultipartReader;->closed:Z
const/4 v0, 0x0
.line 190
move-object v1, v0
check-cast v1, Lokhttp3/MultipartReader$PartSource;
iput-object v0, p0, Lokhttp3/MultipartReader;->currentPart:Lokhttp3/MultipartReader$PartSource;
iget-object p0, p0, Lokhttp3/MultipartReader;->source:Lokio/BufferedSource;
.line 191
invoke-interface {p0}, Lokio/BufferedSource;->close()V
return-void
.end method
.method public final nextPart()Lokhttp3/MultipartReader$Part;
.locals 7
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
iget-boolean v0, p0, Lokhttp3/MultipartReader;->closed:Z
const/4 v1, 0x1
xor-int/2addr v0, v1
if-eqz v0, :cond_9
iget-boolean v0, p0, Lokhttp3/MultipartReader;->noMoreParts:Z
const/4 v2, 0x0
if-eqz v0, :cond_0
return-object v2
:cond_0
iget v0, p0, Lokhttp3/MultipartReader;->partCount:I
const-wide/16 v3, 0x0
if-nez v0, :cond_1
iget-object v0, p0, Lokhttp3/MultipartReader;->source:Lokio/BufferedSource;
iget-object v5, p0, Lokhttp3/MultipartReader;->dashDashBoundary:Lokio/ByteString;
.line 97
invoke-interface {v0, v3, v4, v5}, Lokio/BufferedSource;->rangeEquals(JLokio/ByteString;)Z
move-result v0
if-eqz v0, :cond_1
iget-object v0, p0, Lokhttp3/MultipartReader;->source:Lokio/BufferedSource;
iget-object v3, p0, Lokhttp3/MultipartReader;->dashDashBoundary:Lokio/ByteString;
.line 99
invoke-virtual {v3}, Lokio/ByteString;->size()I
move-result v3
int-to-long v3, v3
invoke-interface {v0, v3, v4}, Lokio/BufferedSource;->skip(J)V
goto :goto_1
:cond_1
:goto_0
const-wide/16 v5, 0x2000
.line 103
invoke-direct {p0, v5, v6}, Lokhttp3/MultipartReader;->currentPartBytesRemaining(J)J
move-result-wide v5
cmp-long v0, v5, v3
if-nez v0, :cond_8
iget-object v0, p0, Lokhttp3/MultipartReader;->source:Lokio/BufferedSource;
iget-object v3, p0, Lokhttp3/MultipartReader;->crlfDashDashBoundary:Lokio/ByteString;
.line 107
invoke-virtual {v3}, Lokio/ByteString;->size()I
move-result v3
int-to-long v3, v3
invoke-interface {v0, v3, v4}, Lokio/BufferedSource;->skip(J)V
:goto_1
const/4 v0, 0x0
:goto_2
iget-object v3, p0, Lokhttp3/MultipartReader;->source:Lokio/BufferedSource;
sget-object v4, Lokhttp3/MultipartReader;->afterBoundaryOptions:Lokio/Options;
.line 113
invoke-interface {v3, v4}, Lokio/BufferedSource;->select(Lokio/Options;)I
move-result v3
const/4 v4, -0x1
const-string v5, "unexpected characters after boundary"
if-eq v3, v4, :cond_7
if-eqz v3, :cond_6
if-eq v3, v1, :cond_3
const/4 v4, 0x2
if-eq v3, v4, :cond_2
const/4 v4, 0x3
if-eq v3, v4, :cond_2
goto :goto_2
:cond_2
move v0, v1
goto :goto_2
:cond_3
if-nez v0, :cond_5
iget v0, p0, Lokhttp3/MultipartReader;->partCount:I
if-eqz v0, :cond_4
iput-boolean v1, p0, Lokhttp3/MultipartReader;->noMoreParts:Z
return-object v2
.line 123
:cond_4
new-instance p0, Ljava/net/ProtocolException;
const-string v0, "expected at least 1 part"
invoke-direct {p0, v0}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
check-cast p0, Ljava/lang/Throwable;
throw p0
.line 122
:cond_5
new-instance p0, Ljava/net/ProtocolException;
invoke-direct {p0, v5}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
check-cast p0, Ljava/lang/Throwable;
throw p0
:cond_6
iget v0, p0, Lokhttp3/MultipartReader;->partCount:I
add-int/2addr v0, v1
iput v0, p0, Lokhttp3/MultipartReader;->partCount:I
.line 139
new-instance v0, Lokhttp3/internal/http1/HeadersReader;
iget-object v1, p0, Lokhttp3/MultipartReader;->source:Lokio/BufferedSource;
invoke-direct {v0, v1}, Lokhttp3/internal/http1/HeadersReader;-><init>(Lokio/BufferedSource;)V
invoke-virtual {v0}, Lokhttp3/internal/http1/HeadersReader;->readHeaders()Lokhttp3/Headers;
move-result-object v0
.line 140
new-instance v1, Lokhttp3/MultipartReader$PartSource;
invoke-direct {v1, p0}, Lokhttp3/MultipartReader$PartSource;-><init>(Lokhttp3/MultipartReader;)V
iput-object v1, p0, Lokhttp3/MultipartReader;->currentPart:Lokhttp3/MultipartReader$PartSource;
.line 142
new-instance p0, Lokhttp3/MultipartReader$Part;
check-cast v1, Lokio/Source;
invoke-static {v1}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource;
move-result-object v1
invoke-direct {p0, v0, v1}, Lokhttp3/MultipartReader$Part;-><init>(Lokhttp3/Headers;Lokio/BufferedSource;)V
return-object p0
.line 134
:cond_7
new-instance p0, Ljava/net/ProtocolException;
invoke-direct {p0, v5}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
check-cast p0, Ljava/lang/Throwable;
throw p0
:cond_8
iget-object v0, p0, Lokhttp3/MultipartReader;->source:Lokio/BufferedSource;
.line 105
invoke-interface {v0, v5, v6}, Lokio/BufferedSource;->skip(J)V
goto :goto_0
.line 92
:cond_9
new-instance p0, Ljava/lang/IllegalStateException;
const-string v0, "closed"
invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {p0, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
check-cast p0, Ljava/lang/Throwable;
throw p0
.end method