Rabbit-R1/switch port/smali/smali_classes3/okhttp3/MultipartBody.smali
2024-05-21 17:08:36 -04:00

772 lines
20 KiB
Smali

.class public final Lokhttp3/MultipartBody;
.super Lokhttp3/RequestBody;
.source "MultipartBody.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lokhttp3/MultipartBody$Part;,
Lokhttp3/MultipartBody$Builder;,
Lokhttp3/MultipartBody$Companion;
}
.end annotation
.annotation runtime Lkotlin/Metadata;
bv = {
0x1,
0x0,
0x3
}
d1 = {
"\u0000N\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u000e\n\u0002\u0008\u0002\n\u0002\u0010\t\n\u0002\u0008\u0003\n\u0002\u0010\u0008\n\u0002\u0008\n\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0002\n\u0002\u0008\u0004\u0018\u0000 #2\u00020\u0001:\u0003\"#$B%\u0008\u0000\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\u000c\u0010\u0006\u001a\u0008\u0012\u0004\u0012\u00020\u00080\u0007\u00a2\u0006\u0002\u0010\tJ\r\u0010\n\u001a\u00020\u000bH\u0007\u00a2\u0006\u0002\u0008\u0015J\u0008\u0010\r\u001a\u00020\u000eH\u0016J\u0008\u0010\u000f\u001a\u00020\u0005H\u0016J\u000e\u0010\u0016\u001a\u00020\u00082\u0006\u0010\u0017\u001a\u00020\u0012J\u0013\u0010\u0006\u001a\u0008\u0012\u0004\u0012\u00020\u00080\u0007H\u0007\u00a2\u0006\u0002\u0008\u0018J\r\u0010\u0011\u001a\u00020\u0012H\u0007\u00a2\u0006\u0002\u0008\u0019J\r\u0010\u0004\u001a\u00020\u0005H\u0007\u00a2\u0006\u0002\u0008\u001aJ\u001a\u0010\u001b\u001a\u00020\u000e2\u0008\u0010\u001c\u001a\u0004\u0018\u00010\u001d2\u0006\u0010\u001e\u001a\u00020\u001fH\u0002J\u0010\u0010 \u001a\u00020!2\u0006\u0010\u001c\u001a\u00020\u001dH\u0016R\u0011\u0010\n\u001a\u00020\u000b8G\u00a2\u0006\u0006\u001a\u0004\u0008\n\u0010\u000cR\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u000eX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u000f\u001a\u00020\u0005X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0019\u0010\u0006\u001a\u0008\u0012\u0004\u0012\u00020\u00080\u00078\u0007\u00a2\u0006\u0008\n\u0000\u001a\u0004\u0008\u0006\u0010\u0010R\u0011\u0010\u0011\u001a\u00020\u00128G\u00a2\u0006\u0006\u001a\u0004\u0008\u0011\u0010\u0013R\u0013\u0010\u0004\u001a\u00020\u00058\u0007\u00a2\u0006\u0008\n\u0000\u001a\u0004\u0008\u0004\u0010\u0014\u00a8\u0006%"
}
d2 = {
"Lokhttp3/MultipartBody;",
"Lokhttp3/RequestBody;",
"boundaryByteString",
"Lokio/ByteString;",
"type",
"Lokhttp3/MediaType;",
"parts",
"",
"Lokhttp3/MultipartBody$Part;",
"(Lokio/ByteString;Lokhttp3/MediaType;Ljava/util/List;)V",
"boundary",
"",
"()Ljava/lang/String;",
"contentLength",
"",
"contentType",
"()Ljava/util/List;",
"size",
"",
"()I",
"()Lokhttp3/MediaType;",
"-deprecated_boundary",
"part",
"index",
"-deprecated_parts",
"-deprecated_size",
"-deprecated_type",
"writeOrCountBytes",
"sink",
"Lokio/BufferedSink;",
"countBytes",
"",
"writeTo",
"",
"Builder",
"Companion",
"Part",
"okhttp"
}
k = 0x1
mv = {
0x1,
0x4,
0x0
}
.end annotation
# static fields
.field public static final ALTERNATIVE:Lokhttp3/MediaType;
.field private static final COLONSPACE:[B
.field private static final CRLF:[B
.field public static final Companion:Lokhttp3/MultipartBody$Companion;
.field private static final DASHDASH:[B
.field public static final DIGEST:Lokhttp3/MediaType;
.field public static final FORM:Lokhttp3/MediaType;
.field public static final MIXED:Lokhttp3/MediaType;
.field public static final PARALLEL:Lokhttp3/MediaType;
# instance fields
.field private final boundaryByteString:Lokio/ByteString;
.field private contentLength:J
.field private final contentType:Lokhttp3/MediaType;
.field private final parts:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Lokhttp3/MultipartBody$Part;",
">;"
}
.end annotation
.end field
.field private final type:Lokhttp3/MediaType;
# direct methods
.method static constructor <clinit>()V
.locals 5
new-instance v0, Lokhttp3/MultipartBody$Companion;
const/4 v1, 0x0
invoke-direct {v0, v1}, Lokhttp3/MultipartBody$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
sput-object v0, Lokhttp3/MultipartBody;->Companion:Lokhttp3/MultipartBody$Companion;
.line 284
sget-object v0, Lokhttp3/MediaType;->Companion:Lokhttp3/MediaType$Companion;
const-string v1, "multipart/mixed"
invoke-virtual {v0, v1}, Lokhttp3/MediaType$Companion;->get(Ljava/lang/String;)Lokhttp3/MediaType;
move-result-object v0
sput-object v0, Lokhttp3/MultipartBody;->MIXED:Lokhttp3/MediaType;
.line 292
sget-object v0, Lokhttp3/MediaType;->Companion:Lokhttp3/MediaType$Companion;
const-string v1, "multipart/alternative"
invoke-virtual {v0, v1}, Lokhttp3/MediaType$Companion;->get(Ljava/lang/String;)Lokhttp3/MediaType;
move-result-object v0
sput-object v0, Lokhttp3/MultipartBody;->ALTERNATIVE:Lokhttp3/MediaType;
.line 300
sget-object v0, Lokhttp3/MediaType;->Companion:Lokhttp3/MediaType$Companion;
const-string v1, "multipart/digest"
invoke-virtual {v0, v1}, Lokhttp3/MediaType$Companion;->get(Ljava/lang/String;)Lokhttp3/MediaType;
move-result-object v0
sput-object v0, Lokhttp3/MultipartBody;->DIGEST:Lokhttp3/MediaType;
.line 307
sget-object v0, Lokhttp3/MediaType;->Companion:Lokhttp3/MediaType$Companion;
const-string v1, "multipart/parallel"
invoke-virtual {v0, v1}, Lokhttp3/MediaType$Companion;->get(Ljava/lang/String;)Lokhttp3/MediaType;
move-result-object v0
sput-object v0, Lokhttp3/MultipartBody;->PARALLEL:Lokhttp3/MediaType;
.line 315
sget-object v0, Lokhttp3/MediaType;->Companion:Lokhttp3/MediaType$Companion;
const-string v1, "multipart/form-data"
invoke-virtual {v0, v1}, Lokhttp3/MediaType$Companion;->get(Ljava/lang/String;)Lokhttp3/MediaType;
move-result-object v0
sput-object v0, Lokhttp3/MultipartBody;->FORM:Lokhttp3/MediaType;
const/4 v0, 0x2
new-array v1, v0, [B
const/16 v2, 0x3a
int-to-byte v2, v2
const/4 v3, 0x0
aput-byte v2, v1, v3
const/16 v2, 0x20
int-to-byte v2, v2
const/4 v4, 0x1
aput-byte v2, v1, v4
sput-object v1, Lokhttp3/MultipartBody;->COLONSPACE:[B
new-array v1, v0, [B
const/16 v2, 0xd
int-to-byte v2, v2
aput-byte v2, v1, v3
const/16 v2, 0xa
int-to-byte v2, v2
aput-byte v2, v1, v4
sput-object v1, Lokhttp3/MultipartBody;->CRLF:[B
new-array v0, v0, [B
const/16 v1, 0x2d
int-to-byte v1, v1
aput-byte v1, v0, v3
aput-byte v1, v0, v4
sput-object v0, Lokhttp3/MultipartBody;->DASHDASH:[B
return-void
.end method
.method public constructor <init>(Lokio/ByteString;Lokhttp3/MediaType;Ljava/util/List;)V
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lokio/ByteString;",
"Lokhttp3/MediaType;",
"Ljava/util/List<",
"Lokhttp3/MultipartBody$Part;",
">;)V"
}
.end annotation
const-string v0, "boundaryByteString"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "type"
invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "parts"
invoke-static {p3, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 37
invoke-direct {p0}, Lokhttp3/RequestBody;-><init>()V
iput-object p1, p0, Lokhttp3/MultipartBody;->boundaryByteString:Lokio/ByteString;
iput-object p2, p0, Lokhttp3/MultipartBody;->type:Lokhttp3/MediaType;
iput-object p3, p0, Lokhttp3/MultipartBody;->parts:Ljava/util/List;
.line 38
sget-object p1, Lokhttp3/MediaType;->Companion:Lokhttp3/MediaType$Companion;
new-instance p3, Ljava/lang/StringBuilder;
invoke-direct {p3}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p3, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object p2
const-string p3, "; boundary="
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p2
invoke-virtual {p0}, Lokhttp3/MultipartBody;->boundary()Ljava/lang/String;
move-result-object p3
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p2
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-virtual {p1, p2}, Lokhttp3/MediaType$Companion;->get(Ljava/lang/String;)Lokhttp3/MediaType;
move-result-object p1
iput-object p1, p0, Lokhttp3/MultipartBody;->contentType:Lokhttp3/MediaType;
const-wide/16 p1, -0x1
iput-wide p1, p0, Lokhttp3/MultipartBody;->contentLength:J
return-void
.end method
.method private final writeOrCountBytes(Lokio/BufferedSink;Z)J
.locals 12
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const/4 v0, 0x0
.line 110
move-object v1, v0
check-cast v1, Lokio/Buffer;
if-eqz p2, :cond_0
.line 112
new-instance v0, Lokio/Buffer;
invoke-direct {v0}, Lokio/Buffer;-><init>()V
.line 113
move-object p1, v0
check-cast p1, Lokio/BufferedSink;
:cond_0
iget-object v1, p0, Lokhttp3/MultipartBody;->parts:Ljava/util/List;
.line 116
invoke-interface {v1}, Ljava/util/List;->size()I
move-result v1
const/4 v2, 0x0
const-wide/16 v3, 0x0
move v5, v2
:goto_0
if-ge v5, v1, :cond_6
iget-object v6, p0, Lokhttp3/MultipartBody;->parts:Ljava/util/List;
.line 117
invoke-interface {v6, v5}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v6
check-cast v6, Lokhttp3/MultipartBody$Part;
.line 118
invoke-virtual {v6}, Lokhttp3/MultipartBody$Part;->headers()Lokhttp3/Headers;
move-result-object v7
.line 119
invoke-virtual {v6}, Lokhttp3/MultipartBody$Part;->body()Lokhttp3/RequestBody;
move-result-object v6
.line 121
invoke-static {p1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
sget-object v8, Lokhttp3/MultipartBody;->DASHDASH:[B
invoke-interface {p1, v8}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
iget-object v8, p0, Lokhttp3/MultipartBody;->boundaryByteString:Lokio/ByteString;
.line 122
invoke-interface {p1, v8}, Lokio/BufferedSink;->write(Lokio/ByteString;)Lokio/BufferedSink;
sget-object v8, Lokhttp3/MultipartBody;->CRLF:[B
.line 123
invoke-interface {p1, v8}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
if-eqz v7, :cond_1
.line 126
invoke-virtual {v7}, Lokhttp3/Headers;->size()I
move-result v8
move v9, v2
:goto_1
if-ge v9, v8, :cond_1
.line 127
invoke-virtual {v7, v9}, Lokhttp3/Headers;->name(I)Ljava/lang/String;
move-result-object v10
invoke-interface {p1, v10}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
move-result-object v10
sget-object v11, Lokhttp3/MultipartBody;->COLONSPACE:[B
.line 128
invoke-interface {v10, v11}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
move-result-object v10
.line 129
invoke-virtual {v7, v9}, Lokhttp3/Headers;->value(I)Ljava/lang/String;
move-result-object v11
invoke-interface {v10, v11}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
move-result-object v10
sget-object v11, Lokhttp3/MultipartBody;->CRLF:[B
.line 130
invoke-interface {v10, v11}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
add-int/lit8 v9, v9, 0x1
goto :goto_1
.line 134
:cond_1
invoke-virtual {v6}, Lokhttp3/RequestBody;->contentType()Lokhttp3/MediaType;
move-result-object v7
if-eqz v7, :cond_2
const-string v8, "Content-Type: "
.line 136
invoke-interface {p1, v8}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
move-result-object v8
.line 137
invoke-virtual {v7}, Lokhttp3/MediaType;->toString()Ljava/lang/String;
move-result-object v7
invoke-interface {v8, v7}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
move-result-object v7
sget-object v8, Lokhttp3/MultipartBody;->CRLF:[B
.line 138
invoke-interface {v7, v8}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
.line 141
:cond_2
invoke-virtual {v6}, Lokhttp3/RequestBody;->contentLength()J
move-result-wide v7
const-wide/16 v9, -0x1
cmp-long v11, v7, v9
if-eqz v11, :cond_3
const-string v9, "Content-Length: "
.line 143
invoke-interface {p1, v9}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink;
move-result-object v9
.line 144
invoke-interface {v9, v7, v8}, Lokio/BufferedSink;->writeDecimalLong(J)Lokio/BufferedSink;
move-result-object v9
sget-object v10, Lokhttp3/MultipartBody;->CRLF:[B
.line 145
invoke-interface {v9, v10}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
goto :goto_2
:cond_3
if-eqz p2, :cond_4
.line 148
invoke-static {v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
invoke-virtual {v0}, Lokio/Buffer;->clear()V
return-wide v9
:cond_4
:goto_2
sget-object v9, Lokhttp3/MultipartBody;->CRLF:[B
.line 152
invoke-interface {p1, v9}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
if-eqz p2, :cond_5
add-long/2addr v3, v7
goto :goto_3
.line 157
:cond_5
invoke-virtual {v6, p1}, Lokhttp3/RequestBody;->writeTo(Lokio/BufferedSink;)V
.line 160
:goto_3
invoke-interface {p1, v9}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
add-int/lit8 v5, v5, 0x1
goto/16 :goto_0
.line 163
:cond_6
invoke-static {p1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
sget-object v1, Lokhttp3/MultipartBody;->DASHDASH:[B
invoke-interface {p1, v1}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
iget-object p0, p0, Lokhttp3/MultipartBody;->boundaryByteString:Lokio/ByteString;
.line 164
invoke-interface {p1, p0}, Lokio/BufferedSink;->write(Lokio/ByteString;)Lokio/BufferedSink;
.line 165
invoke-interface {p1, v1}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
sget-object p0, Lokhttp3/MultipartBody;->CRLF:[B
.line 166
invoke-interface {p1, p0}, Lokio/BufferedSink;->write([B)Lokio/BufferedSink;
if-eqz p2, :cond_7
.line 169
invoke-static {v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
invoke-virtual {v0}, Lokio/Buffer;->size()J
move-result-wide p0
add-long/2addr v3, p0
.line 170
invoke-virtual {v0}, Lokio/Buffer;->clear()V
:cond_7
return-wide v3
.end method
# virtual methods
.method public final -deprecated_boundary()Ljava/lang/String;
.locals 0
.annotation runtime Lkotlin/Deprecated;
level = .enum Lkotlin/DeprecationLevel;->ERROR:Lkotlin/DeprecationLevel;
message = "moved to val"
replaceWith = .subannotation Lkotlin/ReplaceWith;
expression = "boundary"
imports = {}
.end subannotation
.end annotation
.line 65
invoke-virtual {p0}, Lokhttp3/MultipartBody;->boundary()Ljava/lang/String;
move-result-object p0
return-object p0
.end method
.method public final -deprecated_parts()Ljava/util/List;
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/List<",
"Lokhttp3/MultipartBody$Part;",
">;"
}
.end annotation
.annotation runtime Lkotlin/Deprecated;
level = .enum Lkotlin/DeprecationLevel;->ERROR:Lkotlin/DeprecationLevel;
message = "moved to val"
replaceWith = .subannotation Lkotlin/ReplaceWith;
expression = "parts"
imports = {}
.end subannotation
.end annotation
iget-object p0, p0, Lokhttp3/MultipartBody;->parts:Ljava/util/List;
return-object p0
.end method
.method public final -deprecated_size()I
.locals 0
.annotation runtime Lkotlin/Deprecated;
level = .enum Lkotlin/DeprecationLevel;->ERROR:Lkotlin/DeprecationLevel;
message = "moved to val"
replaceWith = .subannotation Lkotlin/ReplaceWith;
expression = "size"
imports = {}
.end subannotation
.end annotation
.line 72
invoke-virtual {p0}, Lokhttp3/MultipartBody;->size()I
move-result p0
return p0
.end method
.method public final -deprecated_type()Lokhttp3/MediaType;
.locals 0
.annotation runtime Lkotlin/Deprecated;
level = .enum Lkotlin/DeprecationLevel;->ERROR:Lkotlin/DeprecationLevel;
message = "moved to val"
replaceWith = .subannotation Lkotlin/ReplaceWith;
expression = "type"
imports = {}
.end subannotation
.end annotation
iget-object p0, p0, Lokhttp3/MultipartBody;->type:Lokhttp3/MediaType;
return-object p0
.end method
.method public final boundary()Ljava/lang/String;
.locals 0
iget-object p0, p0, Lokhttp3/MultipartBody;->boundaryByteString:Lokio/ByteString;
.line 42
invoke-virtual {p0}, Lokio/ByteString;->utf8()Ljava/lang/String;
move-result-object p0
return-object p0
.end method
.method public contentLength()J
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
iget-wide v0, p0, Lokhttp3/MultipartBody;->contentLength:J
const-wide/16 v2, -0x1
cmp-long v2, v0, v2
if-nez v2, :cond_0
const/4 v0, 0x0
const/4 v1, 0x1
.line 85
invoke-direct {p0, v0, v1}, Lokhttp3/MultipartBody;->writeOrCountBytes(Lokio/BufferedSink;Z)J
move-result-wide v0
iput-wide v0, p0, Lokhttp3/MultipartBody;->contentLength:J
:cond_0
return-wide v0
.end method
.method public contentType()Lokhttp3/MediaType;
.locals 0
iget-object p0, p0, Lokhttp3/MultipartBody;->contentType:Lokhttp3/MediaType;
return-object p0
.end method
.method public final part(I)Lokhttp3/MultipartBody$Part;
.locals 0
iget-object p0, p0, Lokhttp3/MultipartBody;->parts:Ljava/util/List;
.line 48
invoke-interface {p0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object p0
check-cast p0, Lokhttp3/MultipartBody$Part;
return-object p0
.end method
.method public final parts()Ljava/util/List;
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/List<",
"Lokhttp3/MultipartBody$Part;",
">;"
}
.end annotation
iget-object p0, p0, Lokhttp3/MultipartBody;->parts:Ljava/util/List;
return-object p0
.end method
.method public final size()I
.locals 0
iget-object p0, p0, Lokhttp3/MultipartBody;->parts:Ljava/util/List;
.line 46
invoke-interface {p0}, Ljava/util/List;->size()I
move-result p0
return p0
.end method
.method public final type()Lokhttp3/MediaType;
.locals 0
iget-object p0, p0, Lokhttp3/MultipartBody;->type:Lokhttp3/MediaType;
return-object p0
.end method
.method public writeTo(Lokio/BufferedSink;)V
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const-string v0, "sink"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const/4 v0, 0x0
.line 93
invoke-direct {p0, p1, v0}, Lokhttp3/MultipartBody;->writeOrCountBytes(Lokio/BufferedSink;Z)J
return-void
.end method