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

177 lines
4.2 KiB
Smali
Raw Normal View History

2019-02-04 20:05:16 +00:00
.class public final Lokhttp3/MultipartBody$Part;
.super Ljava/lang/Object;
2019-02-04 20:29:01 +00:00
.source "MultipartBody.java"
2019-02-04 20:05:16 +00:00
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lokhttp3/MultipartBody;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x19
name = "Part"
.end annotation
# instance fields
2019-02-14 22:50:29 +00:00
.field final blV:Lokhttp3/Headers;
2019-02-04 20:08:30 +00:00
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end field
2019-02-04 20:05:16 +00:00
2019-02-14 22:50:29 +00:00
.field final blW:Lokhttp3/RequestBody;
2019-02-04 20:05:16 +00:00
# direct methods
.method private constructor <init>(Lokhttp3/Headers;Lokhttp3/RequestBody;)V
.locals 0
2019-02-04 20:08:30 +00:00
.param p1 # Lokhttp3/Headers;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
2019-02-04 20:05:16 +00:00
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
2019-02-14 22:50:29 +00:00
iput-object p1, p0, Lokhttp3/MultipartBody$Part;->blV:Lokhttp3/Headers;
2019-02-04 20:05:16 +00:00
2019-02-14 22:50:29 +00:00
iput-object p2, p0, Lokhttp3/MultipartBody$Part;->blW:Lokhttp3/RequestBody;
2019-02-04 20:05:16 +00:00
return-void
.end method
2019-02-04 20:08:30 +00:00
.method public static a(Ljava/lang/String;Ljava/lang/String;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Part;
2019-02-04 20:05:16 +00:00
.locals 2
2019-02-04 20:08:30 +00:00
.param p1 # Ljava/lang/String;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
if-eqz p0, :cond_1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
new-instance v0, Ljava/lang/StringBuilder;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const-string v1, "form-data; name="
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-static {v0, p0}, Lokhttp3/MultipartBody;->a(Ljava/lang/StringBuilder;Ljava/lang/String;)Ljava/lang/StringBuilder;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
if-eqz p1, :cond_0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const-string p0, "; filename="
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-static {v0, p1}, Lokhttp3/MultipartBody;->a(Ljava/lang/StringBuilder;Ljava/lang/String;)Ljava/lang/StringBuilder;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
:cond_0
const/4 p0, 0x2
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
new-array p0, p0, [Ljava/lang/String;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const/4 p1, 0x0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const-string v1, "Content-Disposition"
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
aput-object v1, p0, p1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const/4 p1, 0x1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
2019-02-04 20:05:16 +00:00
move-result-object v0
2019-02-04 20:08:30 +00:00
aput-object v0, p0, p1
2019-02-04 20:05:16 +00:00
2019-02-04 20:32:01 +00:00
invoke-static {p0}, Lokhttp3/Headers;->e([Ljava/lang/String;)Lokhttp3/Headers;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
move-result-object p0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-static {p0, p2}, Lokhttp3/MultipartBody$Part;->b(Lokhttp3/Headers;Lokhttp3/RequestBody;)Lokhttp3/MultipartBody$Part;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
move-result-object p0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
return-object p0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
:cond_1
new-instance p0, Ljava/lang/NullPointerException;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const-string p1, "name == null"
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-direct {p0, p1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
throw p0
2019-02-04 20:05:16 +00:00
.end method
2019-02-04 20:08:30 +00:00
.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
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
if-eqz p1, :cond_4
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
if-eqz p0, :cond_1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const-string v0, "Content-Type"
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-virtual {p0, v0}, Lokhttp3/Headers;->get(Ljava/lang/String;)Ljava/lang/String;
2019-02-04 20:05:16 +00:00
move-result-object v0
2019-02-04 20:08:30 +00:00
if-nez v0, :cond_0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
goto :goto_0
2019-02-04 20:05:16 +00:00
:cond_0
2019-02-04 20:08:30 +00:00
new-instance p0, Ljava/lang/IllegalArgumentException;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const-string p1, "Unexpected header: Content-Type"
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
throw p0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
:cond_1
:goto_0
if-eqz p0, :cond_3
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const-string v0, "Content-Length"
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-virtual {p0, v0}, Lokhttp3/Headers;->get(Ljava/lang/String;)Ljava/lang/String;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
move-result-object v0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
if-nez v0, :cond_2
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
goto :goto_1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
:cond_2
new-instance p0, Ljava/lang/IllegalArgumentException;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const-string p1, "Unexpected header: Content-Length"
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
throw p0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
:cond_3
:goto_1
new-instance v0, Lokhttp3/MultipartBody$Part;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-direct {v0, p0, p1}, Lokhttp3/MultipartBody$Part;-><init>(Lokhttp3/Headers;Lokhttp3/RequestBody;)V
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
return-object v0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
:cond_4
new-instance p0, Ljava/lang/NullPointerException;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const-string p1, "body == null"
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-direct {p0, p1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
throw p0
2019-02-04 20:05:16 +00:00
.end method