apkfuckery/com.discord/smali_classes2/okhttp3/MultipartBody$Part.smali
2020-07-10 04:01:33 +00:00

277 lines
6.3 KiB
Smali

.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, "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 9
const/4 v0, 0x0
if-eqz p0, :cond_6
const-string v1, "form-data; name="
invoke-static {v1}, Lf/e/b/a/a;->E(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
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}, Lj0/n/c/h;->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"
const/16 v2, 0x13
const/4 v3, 0x0
const/4 v4, 0x0
:goto_0
if-ge v4, v2, :cond_4
invoke-virtual {v1, v4}, Ljava/lang/String;->charAt(I)C
move-result v5
const/16 v6, 0x7e
const/16 v7, 0x21
const/4 v8, 0x1
if-le v7, v5, :cond_1
goto :goto_1
:cond_1
if-lt v6, v5, :cond_2
const/4 v6, 0x1
goto :goto_2
:cond_2
:goto_1
const/4 v6, 0x0
:goto_2
if-eqz v6, :cond_3
add-int/lit8 v4, v4, 0x1
goto :goto_0
:cond_3
const/4 p0, 0x3
new-array p0, p0, [Ljava/lang/Object;
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p1
aput-object p1, p0, v3
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p1
aput-object p1, p0, v8
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}, Ln0/g0/b;->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-virtual {p1, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
invoke-static {p0}, Lj0/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, v3, [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;
new-instance p1, Lokhttp3/Headers;
invoke-direct {p1, p0, v0}, Lokhttp3/Headers;-><init>([Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
invoke-static {p1, 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
:cond_6
const-string p0, "name"
invoke-static {p0}, Lj0/n/c/h;->c(Ljava/lang/String;)V
throw v0
.end method