apkfuckery/com.discord/smali/okhttp3/MultipartBody$Part.smali
2019-07-25 04:21:43 +02:00

176 lines
4.2 KiB
Smali

.class public final Lokhttp3/MultipartBody$Part;
.super Ljava/lang/Object;
.source "MultipartBody.java"
# 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 final bsx:Lokhttp3/Headers;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end field
.field final bsy:Lokhttp3/RequestBody;
# direct methods
.method private constructor <init>(Lokhttp3/Headers;Lokhttp3/RequestBody;)V
.locals 0
.param p1 # Lokhttp3/Headers;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lokhttp3/MultipartBody$Part;->bsx:Lokhttp3/Headers;
iput-object p2, p0, Lokhttp3/MultipartBody$Part;->bsy:Lokhttp3/RequestBody;
return-void
.end method
.method public static a(Ljava/lang/String;Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Part;
.locals 2
.param p1 # Ljava/lang/String;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
if-eqz p0, :cond_1
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "form-data; name="
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-static {v0, p0}, Lokhttp3/MultipartBody;->a(Ljava/lang/StringBuilder;Ljava/lang/String;)Ljava/lang/StringBuilder;
if-eqz p1, :cond_0
const-string p0, "; filename="
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-static {v0, p1}, Lokhttp3/MultipartBody;->a(Ljava/lang/StringBuilder;Ljava/lang/String;)Ljava/lang/StringBuilder;
:cond_0
const/4 p0, 0x2
new-array p0, p0, [Ljava/lang/String;
const/4 p1, 0x0
const-string v1, "Content-Disposition"
aput-object v1, p0, p1
const/4 p1, 0x1
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
aput-object v0, p0, p1
invoke-static {p0}, Lokhttp3/Headers;->f([Ljava/lang/String;)Lokhttp3/Headers;
move-result-object p0
invoke-static {p0, p2}, Lokhttp3/MultipartBody$Part;->b(Lokhttp3/Headers;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Part;
move-result-object p0
return-object p0
:cond_1
new-instance p0, Ljava/lang/NullPointerException;
const-string p1, "name == null"
invoke-direct {p0, p1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method public static b(Lokhttp3/Headers;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Part;
.locals 1
.param p0 # Lokhttp3/Headers;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
if-eqz p1, :cond_4
if-eqz p0, :cond_1
const-string v0, "Content-Type"
invoke-virtual {p0, v0}, Lokhttp3/Headers;->get(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
if-nez v0, :cond_0
goto :goto_0
:cond_0
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string p1, "Unexpected header: Content-Type"
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
:cond_1
:goto_0
if-eqz p0, :cond_3
const-string v0, "Content-Length"
invoke-virtual {p0, v0}, Lokhttp3/Headers;->get(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
if-nez v0, :cond_2
goto :goto_1
:cond_2
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string p1, "Unexpected header: Content-Length"
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
:cond_3
:goto_1
new-instance v0, Lokhttp3/MultipartBody$Part;
invoke-direct {v0, p0, p1}, Lokhttp3/MultipartBody$Part;-><init>(Lokhttp3/Headers;Lokhttp3/RequestBody;)V
return-object v0
:cond_4
new-instance p0, Ljava/lang/NullPointerException;
const-string p1, "body == null"
invoke-direct {p0, p1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw p0
.end method