apkfuckery/com.discord/smali/okhttp3/RequestBody.smali

185 lines
4.5 KiB
Smali
Raw Normal View History

2019-02-04 20:05:16 +00:00
.class public abstract Lokhttp3/RequestBody;
.super Ljava/lang/Object;
2019-02-04 20:29:01 +00:00
.source "RequestBody.java"
2019-02-04 20:05:16 +00:00
# direct methods
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static create(Lokhttp3/MediaType;Ljava/io/File;)Lokhttp3/RequestBody;
2019-02-04 20:08:30 +00:00
.locals 1
.param p0 # Lokhttp3/MediaType;
.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_0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
new-instance v0, Lokhttp3/RequestBody$3;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-direct {v0, p0, p1}, Lokhttp3/RequestBody$3;-><init>(Lokhttp3/MediaType;Ljava/io/File;)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
:cond_0
2019-02-04 20:08:30 +00:00
new-instance p0, Ljava/lang/NullPointerException;
2019-02-04 20:05:16 +00:00
2019-02-17 02:24:41 +00:00
const-string p1, "file == 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
throw p0
2019-02-04 20:05:16 +00:00
.end method
.method public static create(Lokhttp3/MediaType;Ljava/lang/String;)Lokhttp3/RequestBody;
2019-02-04 20:08:30 +00:00
.locals 2
.param p0 # Lokhttp3/MediaType;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
2019-02-04 20:05:16 +00:00
2019-02-27 21:13:14 +00:00
sget-object v0, Lokhttp3/internal/c;->UTF_8:Ljava/nio/charset/Charset;
2019-02-04 20:05:16 +00:00
if-eqz p0, :cond_0
2019-02-04 20:08:30 +00:00
const/4 v0, 0x0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-virtual {p0, v0}, Lokhttp3/MediaType;->b(Ljava/nio/charset/Charset;)Ljava/nio/charset/Charset;
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_0
2019-02-04 20:05:16 +00:00
2019-02-27 21:13:14 +00:00
sget-object v0, Lokhttp3/internal/c;->UTF_8:Ljava/nio/charset/Charset;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
new-instance v1, Ljava/lang/StringBuilder;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const-string p0, "; charset=utf-8"
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-virtual {v1, 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-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
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-05-04 02:59:52 +00:00
invoke-static {p0}, Lokhttp3/MediaType;->dU(Ljava/lang/String;)Lokhttp3/MediaType;
2019-02-04 20:05:16 +00:00
move-result-object p0
:cond_0
2019-02-04 20:08:30 +00:00
invoke-virtual {p1, v0}, Ljava/lang/String;->getBytes(Ljava/nio/charset/Charset;)[B
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
move-result-object p1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-static {p0, p1}, Lokhttp3/RequestBody;->create(Lokhttp3/MediaType;[B)Lokhttp3/RequestBody;
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
.end method
.method public static create(Lokhttp3/MediaType;Lokio/ByteString;)Lokhttp3/RequestBody;
.locals 1
2019-02-04 20:08:30 +00:00
.param p0 # Lokhttp3/MediaType;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
2019-02-04 20:05:16 +00:00
new-instance v0, Lokhttp3/RequestBody$1;
invoke-direct {v0, p0, p1}, Lokhttp3/RequestBody$1;-><init>(Lokhttp3/MediaType;Lokio/ByteString;)V
return-object v0
.end method
.method public static create(Lokhttp3/MediaType;[B)Lokhttp3/RequestBody;
.locals 2
2019-02-04 20:08:30 +00:00
.param p0 # Lokhttp3/MediaType;
.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
array-length v0, p1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const/4 v1, 0x0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-static {p0, p1, v1, v0}, Lokhttp3/RequestBody;->create(Lokhttp3/MediaType;[BII)Lokhttp3/RequestBody;
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
.end method
.method public static create(Lokhttp3/MediaType;[BII)Lokhttp3/RequestBody;
2019-02-04 20:08:30 +00:00
.locals 7
.param p0 # Lokhttp3/MediaType;
.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_0
2019-02-04 20:05:16 +00:00
array-length v0, p1
2019-02-04 20:08:30 +00:00
int-to-long v1, v0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
int-to-long v3, p2
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
int-to-long v5, p3
2019-02-04 20:05:16 +00:00
2019-02-04 20:32:01 +00:00
invoke-static/range {v1 .. v6}, Lokhttp3/internal/c;->a(JJJ)V
2019-02-04 20:05:16 +00:00
new-instance v0, Lokhttp3/RequestBody$2;
invoke-direct {v0, p0, p3, p1, p2}, Lokhttp3/RequestBody$2;-><init>(Lokhttp3/MediaType;I[BI)V
return-object v0
2019-02-04 20:08:30 +00:00
:cond_0
new-instance p0, Ljava/lang/NullPointerException;
const-string p1, "content == null"
invoke-direct {p0, p1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw p0
2019-02-04 20:05:16 +00:00
.end method
# virtual methods
.method public contentLength()J
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const-wide/16 v0, -0x1
return-wide v0
.end method
.method public abstract contentType()Lokhttp3/MediaType;
2019-02-04 20:08:30 +00:00
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
2019-02-04 20:05:16 +00:00
.end method
.method public abstract writeTo(Lokio/BufferedSink;)V
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.end method