apkfuckery/com.discord/smali_classes2/okhttp3/MultipartBody$Part.smali

293 lines
7.1 KiB
Smali
Raw Normal View History

2020-05-17 12:40:10 +00:00
.class public final Lokhttp3/MultipartBody$Part;
.super Ljava/lang/Object;
.source "MultipartBody.kt"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lokhttp3/MultipartBody;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x19
name = "Part"
.end annotation
# instance fields
.field public final a:Lokhttp3/Headers;
.field public final b:Lokhttp3/RequestBody;
# direct methods
2020-07-08 16:44:49 +00:00
.method public constructor <init>(Lokhttp3/Headers;Lokhttp3/RequestBody;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lokhttp3/MultipartBody$Part;->a:Lokhttp3/Headers;
iput-object p2, p0, Lokhttp3/MultipartBody$Part;->b:Lokhttp3/RequestBody;
return-void
.end method
.method public static final a(Lokhttp3/Headers;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Part;
2020-05-17 12:40:10 +00:00
.locals 2
2020-09-09 19:21:20 +00:00
const-string v0, "body"
invoke-static {p1, v0}, Lk0/n/c/i;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
2020-07-08 16:44:49 +00:00
const-string v0, "Content-Type"
invoke-virtual {p0, v0}, Lokhttp3/Headers;->c(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
2020-05-17 12:40:10 +00:00
const/4 v1, 0x0
2020-07-08 16:44:49 +00:00
if-nez v0, :cond_0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
const/4 v0, 0x1
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
goto :goto_0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:cond_0
const/4 v0, 0x0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:goto_0
if-eqz v0, :cond_3
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
const-string v0, "Content-Length"
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-virtual {p0, v0}, Lokhttp3/Headers;->c(Ljava/lang/String;)Ljava/lang/String;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
move-result-object v0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
if-nez v0, :cond_1
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
const/4 v1, 0x1
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:cond_1
if-eqz v1, :cond_2
new-instance v0, Lokhttp3/MultipartBody$Part;
const/4 v1, 0x0
invoke-direct {v0, p0, p1, v1}, Lokhttp3/MultipartBody$Part;-><init>(Lokhttp3/Headers;Lokhttp3/RequestBody;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
2020-05-17 12:40:10 +00:00
return-object v0
2020-07-08 16:44:49 +00:00
:cond_2
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string p1, "Unexpected header: Content-Length"
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object p1
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
:cond_3
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string p1, "Unexpected header: Content-Type"
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object p1
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
2020-05-17 12:40:10 +00:00
.end method
2020-07-08 16:44:49 +00:00
.method public static final b(Ljava/lang/String;Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Part;
2020-09-09 19:21:20 +00:00
.locals 10
2020-05-17 12:40:10 +00:00
2020-09-09 19:21:20 +00:00
const-string v0, "name"
invoke-static {p0, v0}, Lk0/n/c/i;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const-string v1, "body"
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
invoke-static {p2, v1}, Lk0/n/c/i;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
new-instance v1, Ljava/lang/StringBuilder;
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
2020-09-02 04:07:20 +00:00
2020-09-09 19:21:20 +00:00
const-string v2, "form-data; name="
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
2020-07-08 16:44:49 +00:00
sget-object v2, Lokhttp3/MultipartBody;->k:Lokhttp3/MultipartBody$b;
invoke-virtual {v2, v1, p0}, Lokhttp3/MultipartBody$b;->a(Ljava/lang/StringBuilder;Ljava/lang/String;)V
if-eqz p1, :cond_0
const-string p0, "; filename="
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
sget-object p0, Lokhttp3/MultipartBody;->k:Lokhttp3/MultipartBody$b;
invoke-virtual {p0, v1, p1}, Lokhttp3/MultipartBody$b;->a(Ljava/lang/StringBuilder;Ljava/lang/String;)V
:cond_0
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
const-string p1, "StringBuilder().apply(builderAction).toString()"
2020-09-09 19:21:20 +00:00
invoke-static {p0, p1}, Lk0/n/c/i;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
2020-07-08 16:44:49 +00:00
new-instance p1, Ljava/util/ArrayList;
const/16 v1, 0x14
invoke-direct {p1, v1}, Ljava/util/ArrayList;-><init>(I)V
const-string v1, "Content-Disposition"
2020-09-09 19:21:20 +00:00
invoke-static {v1, v0}, Lk0/n/c/i;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const-string v2, "value"
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
invoke-static {p0, v2}, Lk0/n/c/i;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const/16 v3, 0x13
2020-07-08 16:44:49 +00:00
const/4 v4, 0x0
2020-09-09 19:21:20 +00:00
const/4 v5, 0x0
2020-07-08 16:44:49 +00:00
:goto_0
2020-09-09 19:21:20 +00:00
if-ge v5, v3, :cond_4
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
invoke-virtual {v1, v5}, Ljava/lang/String;->charAt(I)C
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
move-result v6
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
const/16 v7, 0x7e
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
const/16 v8, 0x21
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
const/4 v9, 0x1
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
if-le v8, v6, :cond_1
2020-07-08 16:44:49 +00:00
goto :goto_1
:cond_1
2020-09-09 19:21:20 +00:00
if-lt v7, v6, :cond_2
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
const/4 v7, 0x1
2020-07-08 16:44:49 +00:00
goto :goto_2
:cond_2
:goto_1
2020-09-09 19:21:20 +00:00
const/4 v7, 0x0
2020-07-08 16:44:49 +00:00
:goto_2
2020-09-09 19:21:20 +00:00
if-eqz v7, :cond_3
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
add-int/lit8 v5, v5, 0x1
2020-07-08 16:44:49 +00:00
goto :goto_0
:cond_3
const/4 p0, 0x3
new-array p0, p0, [Ljava/lang/Object;
2020-09-09 19:21:20 +00:00
invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
2020-07-08 16:44:49 +00:00
move-result-object p1
2020-09-09 19:21:20 +00:00
aput-object p1, p0, v4
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
2020-07-08 16:44:49 +00:00
move-result-object p1
2020-09-09 19:21:20 +00:00
aput-object p1, p0, v9
2020-07-08 16:44:49 +00:00
const/4 p1, 0x2
aput-object v1, p0, p1
const-string p1, "Unexpected char %#04x at %d in header name: %s"
2020-09-09 19:21:20 +00:00
invoke-static {p1, p0}, Lo0/h0/c;->l(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
2020-07-08 16:44:49 +00:00
move-result-object p0
new-instance p1, Ljava/lang/IllegalArgumentException;
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
:cond_4
2020-09-09 19:21:20 +00:00
invoke-static {v1, v0}, Lk0/n/c/i;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-static {p0, v2}, Lk0/n/c/i;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
2020-07-08 16:44:49 +00:00
invoke-virtual {p1, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
2020-09-08 08:16:32 +00:00
invoke-static {p0}, Lk0/t/p;->trim(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
2020-07-08 16:44:49 +00:00
move-result-object p0
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object p0
invoke-virtual {p1, p0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
2020-09-09 19:21:20 +00:00
new-array p0, v4, [Ljava/lang/String;
2020-07-08 16:44:49 +00:00
invoke-virtual {p1, p0}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
move-result-object p0
if-eqz p0, :cond_5
check-cast p0, [Ljava/lang/String;
2020-09-09 19:21:20 +00:00
const/4 p1, 0x0
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
new-instance v0, Lokhttp3/Headers;
2020-07-08 16:44:49 +00:00
2020-09-09 19:21:20 +00:00
invoke-direct {v0, p0, p1}, Lokhttp3/Headers;-><init>([Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
invoke-static {v0, p2}, Lokhttp3/MultipartBody$Part;->a(Lokhttp3/Headers;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Part;
2020-07-08 16:44:49 +00:00
move-result-object p0
return-object p0
:cond_5
new-instance p0, Lkotlin/TypeCastException;
const-string p1, "null cannot be cast to non-null type kotlin.Array<T>"
invoke-direct {p0, p1}, Lkotlin/TypeCastException;-><init>(Ljava/lang/String;)V
throw p0
2020-05-17 12:40:10 +00:00
.end method