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

293 lines
7.1 KiB
Smali
Raw Normal View History

2020-11-12 02:11:44 +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
.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;
.locals 2
const-string v0, "body"
invoke-static {p1, v0}, Lz/n/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "Content-Type"
invoke-virtual {p0, v0}, Lokhttp3/Headers;->c(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
const/4 v1, 0x0
if-nez v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
if-eqz v0, :cond_3
const-string v0, "Content-Length"
invoke-virtual {p0, v0}, Lokhttp3/Headers;->c(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
if-nez v0, :cond_1
const/4 v1, 0x1
: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
return-object v0
: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
.end method
.method public static final b(Ljava/lang/String;Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Part;
.locals 10
const-string v0, "name"
invoke-static {p0, v0}, Lz/n/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const-string v1, "body"
invoke-static {p2, v1}, Lz/n/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "form-data; name="
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
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()"
invoke-static {p0, p1}, Lz/n/c/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
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"
invoke-static {v1, v0}, Lz/n/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const-string v2, "value"
invoke-static {p0, v2}, Lz/n/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const/16 v3, 0x13
const/4 v4, 0x0
const/4 v5, 0x0
:goto_0
if-ge v5, v3, :cond_4
invoke-virtual {v1, v5}, Ljava/lang/String;->charAt(I)C
move-result v6
const/16 v7, 0x7e
const/16 v8, 0x21
const/4 v9, 0x1
if-le v8, v6, :cond_1
goto :goto_1
:cond_1
if-lt v7, v6, :cond_2
const/4 v7, 0x1
goto :goto_2
:cond_2
:goto_1
const/4 v7, 0x0
:goto_2
if-eqz v7, :cond_3
add-int/lit8 v5, v5, 0x1
goto :goto_0
:cond_3
const/4 p0, 0x3
new-array p0, p0, [Ljava/lang/Object;
invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p1
aput-object p1, p0, v4
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p1
aput-object p1, p0, v9
const/4 p1, 0x2
aput-object v1, p0, p1
const-string p1, "Unexpected char %#04x at %d in header name: %s"
invoke-static {p1, p0}, Ld0/h0/c;->l(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
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
invoke-static {v1, v0}, Lz/n/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-static {p0, v2}, Lz/n/c/j;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {p1, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
invoke-static {p0}, Lz/t/p;->trim(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
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
new-array p0, v4, [Ljava/lang/String;
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;
const/4 p1, 0x0
new-instance v0, Lokhttp3/Headers;
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;
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
.end method