833 lines
19 KiB
Smali
833 lines
19 KiB
Smali
.class public final Lcom/discord/restapi/RestAPIBuilder;
|
|
.super Ljava/lang/Object;
|
|
.source "RestAPIBuilder.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/restapi/RestAPIBuilder$Companion;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final API_VERSION:I = 0x6
|
|
|
|
.field public static final CONTENT_TYPE_JSON:Ljava/lang/String; = "application/json"
|
|
|
|
.field public static final CONTENT_TYPE_TEXT:Ljava/lang/String; = "text/plain"
|
|
|
|
.field public static final Companion:Lcom/discord/restapi/RestAPIBuilder$Companion;
|
|
|
|
.field public static final DEFAULT_TIMEOUT_MILLIS:J = 0x2710L
|
|
|
|
.field public static clientCallback:Lkotlin/jvm/functions/Function2;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lkotlin/jvm/functions/Function2<",
|
|
"-",
|
|
"Ljava/lang/String;",
|
|
"-",
|
|
"Lx/v;",
|
|
"Lkotlin/Unit;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# instance fields
|
|
.field public final baseApiUrl:Ljava/lang/String;
|
|
|
|
.field public final cookieJar:Lx/n;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 2
|
|
|
|
new-instance v0, Lcom/discord/restapi/RestAPIBuilder$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/restapi/RestAPIBuilder$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sput-object v0, Lcom/discord/restapi/RestAPIBuilder;->Companion:Lcom/discord/restapi/RestAPIBuilder$Companion;
|
|
|
|
sget-object v0, Lcom/discord/restapi/RestAPIBuilder$Companion$clientCallback$1;->INSTANCE:Lcom/discord/restapi/RestAPIBuilder$Companion$clientCallback$1;
|
|
|
|
sput-object v0, Lcom/discord/restapi/RestAPIBuilder;->clientCallback:Lkotlin/jvm/functions/Function2;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Ljava/lang/String;Lx/n;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/restapi/RestAPIBuilder;->baseApiUrl:Ljava/lang/String;
|
|
|
|
iput-object p2, p0, Lcom/discord/restapi/RestAPIBuilder;->cookieJar:Lx/n;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "cookieJar"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "baseApiUrl"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getClientCallback$cp()Lkotlin/jvm/functions/Function2;
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/discord/restapi/RestAPIBuilder;->clientCallback:Lkotlin/jvm/functions/Function2;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$setClientCallback$cp(Lkotlin/jvm/functions/Function2;)V
|
|
.locals 0
|
|
|
|
sput-object p0, Lcom/discord/restapi/RestAPIBuilder;->clientCallback:Lkotlin/jvm/functions/Function2;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic build$default(Lcom/discord/restapi/RestAPIBuilder;Ljava/lang/Class;ZJLjava/util/List;Ljava/lang/String;ZLjava/lang/String;ILjava/lang/Object;)Ljava/lang/Object;
|
|
.locals 7
|
|
|
|
and-int/lit8 v0, p9, 0x2
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move v0, p2
|
|
|
|
:goto_0
|
|
and-int/lit8 v1, p9, 0x4
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
const-wide/16 v1, 0x2710
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
move-wide v1, p3
|
|
|
|
:goto_1
|
|
and-int/lit8 v3, p9, 0x8
|
|
|
|
const/4 v4, 0x0
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
move-object v3, v4
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
move-object v3, p5
|
|
|
|
:goto_2
|
|
and-int/lit8 v5, p9, 0x10
|
|
|
|
if-eqz v5, :cond_3
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
move-object v4, p6
|
|
|
|
:goto_3
|
|
and-int/lit8 v5, p9, 0x20
|
|
|
|
if-eqz v5, :cond_4
|
|
|
|
const/4 v5, 0x1
|
|
|
|
goto :goto_4
|
|
|
|
:cond_4
|
|
move v5, p7
|
|
|
|
:goto_4
|
|
and-int/lit8 v6, p9, 0x40
|
|
|
|
if-eqz v6, :cond_5
|
|
|
|
const-string v6, "application/json"
|
|
|
|
goto :goto_5
|
|
|
|
:cond_5
|
|
move-object v6, p8
|
|
|
|
:goto_5
|
|
move-object p2, p0
|
|
|
|
move-object p3, p1
|
|
|
|
move p4, v0
|
|
|
|
move-wide p5, v1
|
|
|
|
move-object p7, v3
|
|
|
|
move-object p8, v4
|
|
|
|
move/from16 p9, v5
|
|
|
|
move-object/from16 p10, v6
|
|
|
|
invoke-virtual/range {p2 .. p10}, Lcom/discord/restapi/RestAPIBuilder;->build(Ljava/lang/Class;ZJLjava/util/List;Ljava/lang/String;ZLjava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final buildApi(Lx/v;Ljava/lang/Class;Ljava/lang/String;ZZLjava/lang/String;)Ljava/lang/Object;
|
|
.locals 14
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Lx/v;",
|
|
"Ljava/lang/Class<",
|
|
"TT;>;",
|
|
"Ljava/lang/String;",
|
|
"ZZ",
|
|
"Ljava/lang/String;",
|
|
")TT;"
|
|
}
|
|
.end annotation
|
|
|
|
move-object v1, p1
|
|
|
|
move-object/from16 v7, p2
|
|
|
|
new-instance v0, Le/k/d/k;
|
|
|
|
invoke-direct {v0}, Le/k/d/k;-><init>()V
|
|
|
|
sget-object v2, Le/k/d/d;->g:Le/k/d/d;
|
|
|
|
iput-object v2, v0, Le/k/d/k;->c:Le/k/d/e;
|
|
|
|
new-instance v2, Lcom/discord/models/domain/Model$TypeAdapterFactory;
|
|
|
|
invoke-direct {v2}, Lcom/discord/models/domain/Model$TypeAdapterFactory;-><init>()V
|
|
|
|
iget-object v3, v0, Le/k/d/k;->e:Ljava/util/List;
|
|
|
|
invoke-interface {v3, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
const-class v2, Lcom/discord/restapi/RestAPIParams$ChannelPosition;
|
|
|
|
new-instance v3, Lcom/discord/restapi/RestAPIParams$ChannelPosition$Serializer;
|
|
|
|
invoke-direct {v3}, Lcom/discord/restapi/RestAPIParams$ChannelPosition$Serializer;-><init>()V
|
|
|
|
const/4 v8, 0x1
|
|
|
|
invoke-static {v8}, Le/k/a/b/e/p/g;->a(Z)V
|
|
|
|
instance-of v4, v3, Le/k/d/l;
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
iget-object v4, v0, Le/k/d/k;->d:Ljava/util/Map;
|
|
|
|
move-object v5, v3
|
|
|
|
check-cast v5, Le/k/d/l;
|
|
|
|
invoke-interface {v4, v2, v5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_0
|
|
new-instance v4, Lcom/google/gson/reflect/TypeToken;
|
|
|
|
invoke-direct {v4, v2}, Lcom/google/gson/reflect/TypeToken;-><init>(Ljava/lang/reflect/Type;)V
|
|
|
|
iget-object v5, v0, Le/k/d/k;->e:Ljava/util/List;
|
|
|
|
invoke-virtual {v4}, Lcom/google/gson/reflect/TypeToken;->b()Ljava/lang/reflect/Type;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-virtual {v4}, Lcom/google/gson/reflect/TypeToken;->a()Ljava/lang/Class;
|
|
|
|
move-result-object v9
|
|
|
|
const/4 v10, 0x0
|
|
|
|
if-ne v6, v9, :cond_1
|
|
|
|
const/4 v6, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v6, 0x0
|
|
|
|
:goto_0
|
|
new-instance v9, Le/k/d/z/z/m$c;
|
|
|
|
const/4 v11, 0x0
|
|
|
|
invoke-direct {v9, v3, v4, v6, v11}, Le/k/d/z/z/m$c;-><init>(Ljava/lang/Object;Lcom/google/gson/reflect/TypeToken;ZLjava/lang/Class;)V
|
|
|
|
invoke-interface {v5, v9}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
instance-of v4, v3, Lcom/google/gson/TypeAdapter;
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
iget-object v4, v0, Le/k/d/k;->e:Ljava/util/List;
|
|
|
|
new-instance v5, Lcom/google/gson/reflect/TypeToken;
|
|
|
|
invoke-direct {v5, v2}, Lcom/google/gson/reflect/TypeToken;-><init>(Ljava/lang/reflect/Type;)V
|
|
|
|
check-cast v3, Lcom/google/gson/TypeAdapter;
|
|
|
|
invoke-static {v5, v3}, Le/k/d/z/z/o;->a(Lcom/google/gson/reflect/TypeToken;Lcom/google/gson/TypeAdapter;)Le/k/d/x;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v4, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_2
|
|
if-eqz p4, :cond_3
|
|
|
|
iput-boolean v8, v0, Le/k/d/k;->g:Z
|
|
|
|
:cond_3
|
|
invoke-virtual {v0}, Le/k/d/k;->a()Lcom/google/gson/Gson;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v2, ""
|
|
|
|
if-eqz p5, :cond_4
|
|
|
|
const-string v3, "v6/"
|
|
|
|
move-object v4, v3
|
|
|
|
move-object/from16 v3, p3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
move-object/from16 v3, p3
|
|
|
|
move-object v4, v2
|
|
|
|
:goto_1
|
|
invoke-static {v3, v4}, Le/e/b/a/a;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
const/4 v6, 0x0
|
|
|
|
sget-object v4, La0/m;->a:La0/m;
|
|
|
|
new-instance v5, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v5}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
new-instance v9, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v9}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
new-instance v12, La0/a;
|
|
|
|
invoke-direct {v12}, La0/a;-><init>()V
|
|
|
|
invoke-interface {v5, v12}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
const-string v12, "client == null"
|
|
|
|
invoke-static {p1, v12}, La0/s;->a(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
const-string v12, "factory == null"
|
|
|
|
invoke-static {p1, v12}, La0/s;->a(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
new-instance v13, La0/t/a/j;
|
|
|
|
invoke-direct {v13, v11, v10}, La0/t/a/j;-><init>(Lrx/Scheduler;Z)V
|
|
|
|
invoke-static {v13, v12}, La0/s;->a(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
invoke-interface {v9, v13}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
new-instance v11, La0/u/b/k;
|
|
|
|
invoke-direct {v11}, La0/u/b/k;-><init>()V
|
|
|
|
invoke-static {v11, v12}, La0/s;->a(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
invoke-interface {v5, v11}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
const-string v11, "application/json"
|
|
|
|
move-object/from16 v13, p6
|
|
|
|
invoke-static {v13, v11}, Lt/u/b/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v11
|
|
|
|
if-eqz v11, :cond_5
|
|
|
|
new-instance v11, La0/u/a/a;
|
|
|
|
invoke-direct {v11, v0}, La0/u/a/a;-><init>(Lcom/google/gson/Gson;)V
|
|
|
|
invoke-static {v11, v12}, La0/s;->a(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
invoke-interface {v5, v11}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_5
|
|
const-string v0, "baseUrl == null"
|
|
|
|
invoke-static {v3, v0}, La0/s;->a(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
invoke-static {v3}, Lx/u;->c(Ljava/lang/String;)Lx/u;
|
|
|
|
move-result-object v11
|
|
|
|
if-eqz v11, :cond_9
|
|
|
|
invoke-static {v11, v0}, La0/s;->a(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
iget-object v0, v11, Lx/u;->g:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v3
|
|
|
|
add-int/lit8 v3, v3, -0x1
|
|
|
|
invoke-interface {v0, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_8
|
|
|
|
invoke-virtual {v4}, La0/m;->a()Ljava/util/concurrent/Executor;
|
|
|
|
move-result-object v12
|
|
|
|
new-instance v13, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v13, v9}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
|
|
invoke-virtual {v4, v12}, La0/m;->a(Ljava/util/concurrent/Executor;)La0/c$a;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v13, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
new-instance v3, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v3, v5}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
|
|
new-instance v9, La0/q;
|
|
|
|
move-object v0, v9
|
|
|
|
move-object v1, p1
|
|
|
|
move-object v2, v11
|
|
|
|
move-object v4, v13
|
|
|
|
move-object v5, v12
|
|
|
|
invoke-direct/range {v0 .. v6}, La0/q;-><init>(Lx/e$a;Lx/u;Ljava/util/List;Ljava/util/List;Ljava/util/concurrent/Executor;Z)V
|
|
|
|
invoke-static/range {p2 .. p2}, La0/s;->a(Ljava/lang/Class;)V
|
|
|
|
iget-boolean v0, v9, La0/q;->f:Z
|
|
|
|
if-eqz v0, :cond_7
|
|
|
|
sget-object v0, La0/m;->a:La0/m;
|
|
|
|
invoke-virtual/range {p2 .. p2}, Ljava/lang/Class;->getDeclaredMethods()[Ljava/lang/reflect/Method;
|
|
|
|
move-result-object v1
|
|
|
|
array-length v2, v1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_2
|
|
if-ge v3, v2, :cond_7
|
|
|
|
aget-object v4, v1, v3
|
|
|
|
invoke-virtual {v0, v4}, La0/m;->a(Ljava/lang/reflect/Method;)Z
|
|
|
|
move-result v5
|
|
|
|
if-nez v5, :cond_6
|
|
|
|
invoke-virtual {v9, v4}, La0/q;->a(Ljava/lang/reflect/Method;)La0/r;
|
|
|
|
:cond_6
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_7
|
|
invoke-virtual/range {p2 .. p2}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;
|
|
|
|
move-result-object v0
|
|
|
|
new-array v1, v8, [Ljava/lang/Class;
|
|
|
|
aput-object v7, v1, v10
|
|
|
|
new-instance v2, La0/p;
|
|
|
|
invoke-direct {v2, v9, v7}, La0/p;-><init>(La0/q;Ljava/lang/Class;)V
|
|
|
|
invoke-static {v0, v1, v2}, Ljava/lang/reflect/Proxy;->newProxyInstance(Ljava/lang/ClassLoader;[Ljava/lang/Class;Ljava/lang/reflect/InvocationHandler;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
|
|
:cond_8
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "baseUrl must end in /: "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_9
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v1, "Illegal URL: "
|
|
|
|
invoke-static {v1, v3}, Le/e/b/a/a;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static synthetic buildApi$default(Lcom/discord/restapi/RestAPIBuilder;Lx/v;Ljava/lang/Class;Ljava/lang/String;ZZLjava/lang/String;ILjava/lang/Object;)Ljava/lang/Object;
|
|
.locals 7
|
|
|
|
and-int/lit8 p7, p7, 0x8
|
|
|
|
if-eqz p7, :cond_0
|
|
|
|
const/4 p4, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move v4, p4
|
|
|
|
:goto_0
|
|
move-object v0, p0
|
|
|
|
move-object v1, p1
|
|
|
|
move-object v2, p2
|
|
|
|
move-object v3, p3
|
|
|
|
move v5, p5
|
|
|
|
move-object v6, p6
|
|
|
|
invoke-direct/range {v0 .. v6}, Lcom/discord/restapi/RestAPIBuilder;->buildApi(Lx/v;Ljava/lang/Class;Ljava/lang/String;ZZLjava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final buildOkHttpClient(Ljava/lang/Long;Ljava/util/List;)Lx/v;
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lokhttp3/Interceptor;",
|
|
">;)",
|
|
"Lx/v;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Lx/v$a;
|
|
|
|
invoke-direct {v0}, Lx/v$a;-><init>()V
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
invoke-interface {p2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p2
|
|
|
|
:goto_0
|
|
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lokhttp3/Interceptor;
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
iget-object v3, v0, Lx/v$a;->c:Ljava/util/List;
|
|
|
|
invoke-interface {v3, v2}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const-string p1, "interceptor"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
|
|
:cond_1
|
|
if-eqz p1, :cond_4
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v2
|
|
|
|
sget-object p2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-virtual {v0, v2, v3, p2}, Lx/v$a;->a(JLjava/util/concurrent/TimeUnit;)Lx/v$a;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v2
|
|
|
|
sget-object p2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
const-string v4, "unit"
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
const-string v5, "timeout"
|
|
|
|
invoke-static {v5, v2, v3, p2}, Lx/c0/a;->a(Ljava/lang/String;JLjava/util/concurrent/TimeUnit;)I
|
|
|
|
move-result p2
|
|
|
|
iput p2, v0, Lx/v$a;->z:I
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide p1
|
|
|
|
sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
invoke-static {v5, p1, p2, v2}, Lx/c0/a;->a(Ljava/lang/String;JLjava/util/concurrent/TimeUnit;)I
|
|
|
|
move-result p1
|
|
|
|
iput p1, v0, Lx/v$a;->x:I
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
invoke-static {v4}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
|
|
:cond_3
|
|
invoke-static {v4}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
|
|
:cond_4
|
|
:goto_1
|
|
iget-object p1, p0, Lcom/discord/restapi/RestAPIBuilder;->cookieJar:Lx/n;
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
iput-object p1, v0, Lx/v$a;->j:Lx/n;
|
|
|
|
new-instance p1, Lx/v;
|
|
|
|
invoke-direct {p1, v0}, Lx/v;-><init>(Lx/v$a;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_5
|
|
const-string p1, "cookieJar"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method public static synthetic buildOkHttpClient$default(Lcom/discord/restapi/RestAPIBuilder;Ljava/lang/Long;Ljava/util/List;ILjava/lang/Object;)Lx/v;
|
|
.locals 1
|
|
|
|
and-int/lit8 p4, p3, 0x1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p4, :cond_0
|
|
|
|
move-object p1, v0
|
|
|
|
:cond_0
|
|
and-int/lit8 p3, p3, 0x2
|
|
|
|
if-eqz p3, :cond_1
|
|
|
|
move-object p2, v0
|
|
|
|
:cond_1
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/restapi/RestAPIBuilder;->buildOkHttpClient(Ljava/lang/Long;Ljava/util/List;)Lx/v;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final build(Ljava/lang/Class;ZJLjava/util/List;Ljava/lang/String;ZLjava/lang/String;)Ljava/lang/Object;
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/lang/Class<",
|
|
"TT;>;ZJ",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lokhttp3/Interceptor;",
|
|
">;",
|
|
"Ljava/lang/String;",
|
|
"Z",
|
|
"Ljava/lang/String;",
|
|
")TT;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
if-eqz p8, :cond_1
|
|
|
|
invoke-static {p3, p4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-direct {p0, p3, p5}, Lcom/discord/restapi/RestAPIBuilder;->buildOkHttpClient(Ljava/lang/Long;Ljava/util/List;)Lx/v;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz p6, :cond_0
|
|
|
|
sget-object p3, Lcom/discord/restapi/RestAPIBuilder;->clientCallback:Lkotlin/jvm/functions/Function2;
|
|
|
|
invoke-interface {p3, p6, v1}, Lkotlin/jvm/functions/Function2;->invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_0
|
|
iget-object v3, p0, Lcom/discord/restapi/RestAPIBuilder;->baseApiUrl:Ljava/lang/String;
|
|
|
|
move-object v0, p0
|
|
|
|
move-object v2, p1
|
|
|
|
move v4, p2
|
|
|
|
move v5, p7
|
|
|
|
move-object v6, p8
|
|
|
|
invoke-direct/range {v0 .. v6}, Lcom/discord/restapi/RestAPIBuilder;->buildApi(Lx/v;Ljava/lang/Class;Ljava/lang/String;ZZLjava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_1
|
|
const-string p1, "contentType"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
const-string p1, "apiDefinition"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|