apkfuckery/com.discord/smali/retrofit2/converter/gson/GsonResponseBodyConverter.smali

133 lines
3.8 KiB
Smali
Raw Normal View History

2019-02-04 20:05:16 +00:00
.class final Lretrofit2/converter/gson/GsonResponseBodyConverter;
.super Ljava/lang/Object;
.source "GsonResponseBodyConverter.java"
# interfaces
.implements Lretrofit2/Converter;
# annotations
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">",
"Ljava/lang/Object;",
"Lretrofit2/Converter",
"<",
"Lokhttp3/ResponseBody;",
"TT;>;"
}
.end annotation
# instance fields
.field private final adapter:Lcom/google/gson/TypeAdapter;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/google/gson/TypeAdapter",
"<TT;>;"
}
.end annotation
.end field
.field private final gson:Lcom/google/gson/Gson;
# direct methods
.method constructor <init>(Lcom/google/gson/Gson;Lcom/google/gson/TypeAdapter;)V
.locals 0
.param p1, "gson" # Lcom/google/gson/Gson;
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/google/gson/Gson;",
"Lcom/google/gson/TypeAdapter",
"<TT;>;)V"
}
.end annotation
.prologue
.local p0, "this":Lretrofit2/converter/gson/GsonResponseBodyConverter;, "Lretrofit2/converter/gson/GsonResponseBodyConverter<TT;>;"
.local p2, "adapter":Lcom/google/gson/TypeAdapter;, "Lcom/google/gson/TypeAdapter<TT;>;"
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lretrofit2/converter/gson/GsonResponseBodyConverter;->gson:Lcom/google/gson/Gson;
iput-object p2, p0, Lretrofit2/converter/gson/GsonResponseBodyConverter;->adapter:Lcom/google/gson/TypeAdapter;
return-void
.end method
# virtual methods
.method public bridge synthetic convert(Ljava/lang/Object;)Ljava/lang/Object;
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
.local p0, "this":Lretrofit2/converter/gson/GsonResponseBodyConverter;, "Lretrofit2/converter/gson/GsonResponseBodyConverter<TT;>;"
check-cast p1, Lokhttp3/ResponseBody;
invoke-virtual {p0, p1}, Lretrofit2/converter/gson/GsonResponseBodyConverter;->convert(Lokhttp3/ResponseBody;)Ljava/lang/Object;
move-result-object v0
return-object v0
.end method
.method public convert(Lokhttp3/ResponseBody;)Ljava/lang/Object;
.locals 3
.param p1, "value" # Lokhttp3/ResponseBody;
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lokhttp3/ResponseBody;",
")TT;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
.local p0, "this":Lretrofit2/converter/gson/GsonResponseBodyConverter;, "Lretrofit2/converter/gson/GsonResponseBodyConverter<TT;>;"
iget-object v1, p0, Lretrofit2/converter/gson/GsonResponseBodyConverter;->gson:Lcom/google/gson/Gson;
invoke-virtual {p1}, Lokhttp3/ResponseBody;->charStream()Ljava/io/Reader;
move-result-object v2
invoke-virtual {v1, v2}, Lcom/google/gson/Gson;->newJsonReader(Ljava/io/Reader;)Lcom/google/gson/stream/JsonReader;
move-result-object v0
.local v0, "jsonReader":Lcom/google/gson/stream/JsonReader;
:try_start_0
iget-object v1, p0, Lretrofit2/converter/gson/GsonResponseBodyConverter;->adapter:Lcom/google/gson/TypeAdapter;
invoke-virtual {v1, v0}, Lcom/google/gson/TypeAdapter;->read(Lcom/google/gson/stream/JsonReader;)Ljava/lang/Object;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
move-result-object v1
invoke-virtual {p1}, Lokhttp3/ResponseBody;->close()V
return-object v1
:catchall_0
move-exception v1
invoke-virtual {p1}, Lokhttp3/ResponseBody;->close()V
throw v1
.end method