134 lines
3.2 KiB
Smali
134 lines
3.2 KiB
Smali
.class public final Lp0/t/a/b;
|
|
.super Ljava/lang/Object;
|
|
.source "GsonRequestBodyConverter.java"
|
|
|
|
# interfaces
|
|
.implements Lp0/e;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Ljava/lang/Object;",
|
|
"Lp0/e<",
|
|
"TT;",
|
|
"Lokhttp3/RequestBody;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final c:Lokhttp3/MediaType;
|
|
|
|
.field public static final d:Ljava/nio/charset/Charset;
|
|
|
|
|
|
# instance fields
|
|
.field public final a:Lcom/google/gson/Gson;
|
|
|
|
.field public final b:Lcom/google/gson/TypeAdapter;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/google/gson/TypeAdapter<",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
const-string v0, "application/json; charset=UTF-8"
|
|
|
|
invoke-static {v0}, Lokhttp3/MediaType;->c(Ljava/lang/String;)Lokhttp3/MediaType;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lp0/t/a/b;->c:Lokhttp3/MediaType;
|
|
|
|
const-string v0, "UTF-8"
|
|
|
|
invoke-static {v0}, Ljava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lp0/t/a/b;->d:Ljava/nio/charset/Charset;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Lcom/google/gson/Gson;Lcom/google/gson/TypeAdapter;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/google/gson/Gson;",
|
|
"Lcom/google/gson/TypeAdapter<",
|
|
"TT;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lp0/t/a/b;->a:Lcom/google/gson/Gson;
|
|
|
|
iput-object p2, p0, Lp0/t/a/b;->b:Lcom/google/gson/TypeAdapter;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a(Ljava/lang/Object;)Ljava/lang/Object;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ln0/e;
|
|
|
|
invoke-direct {v0}, Ln0/e;-><init>()V
|
|
|
|
new-instance v1, Ljava/io/OutputStreamWriter;
|
|
|
|
new-instance v2, Ln0/f;
|
|
|
|
invoke-direct {v2, v0}, Ln0/f;-><init>(Ln0/e;)V
|
|
|
|
sget-object v3, Lp0/t/a/b;->d:Ljava/nio/charset/Charset;
|
|
|
|
invoke-direct {v1, v2, v3}, Ljava/io/OutputStreamWriter;-><init>(Ljava/io/OutputStream;Ljava/nio/charset/Charset;)V
|
|
|
|
iget-object v2, p0, Lp0/t/a/b;->a:Lcom/google/gson/Gson;
|
|
|
|
invoke-virtual {v2, v1}, Lcom/google/gson/Gson;->i(Ljava/io/Writer;)Lcom/google/gson/stream/JsonWriter;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lp0/t/a/b;->b:Lcom/google/gson/TypeAdapter;
|
|
|
|
invoke-virtual {v2, v1, p1}, Lcom/google/gson/TypeAdapter;->write(Lcom/google/gson/stream/JsonWriter;Ljava/lang/Object;)V
|
|
|
|
invoke-virtual {v1}, Lcom/google/gson/stream/JsonWriter;->close()V
|
|
|
|
sget-object p1, Lp0/t/a/b;->c:Lokhttp3/MediaType;
|
|
|
|
invoke-virtual {v0}, Ln0/e;->j()Lokio/ByteString;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {p1, v0}, Lokhttp3/RequestBody;->create(Lokhttp3/MediaType;Lokio/ByteString;)Lokhttp3/RequestBody;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|