2020-05-17 12:40:10 +00:00
|
|
|
.class public final Lcom/discord/restapi/RequiredHeadersInterceptor;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "RestInterceptors.kt"
|
|
|
|
|
|
|
|
# interfaces
|
|
|
|
.implements Lokhttp3/Interceptor;
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
|
|
value = {
|
|
|
|
Lcom/discord/restapi/RequiredHeadersInterceptor$HeadersProvider;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field public final headersProvider:Lcom/discord/restapi/RequiredHeadersInterceptor$HeadersProvider;
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>(Lcom/discord/restapi/RequiredHeadersInterceptor$HeadersProvider;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/restapi/RequiredHeadersInterceptor;->headersProvider:Lcom/discord/restapi/RequiredHeadersInterceptor$HeadersProvider;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const-string p1, "headersProvider"
|
|
|
|
|
2020-07-14 22:43:59 +00:00
|
|
|
invoke-static {p1}, Li0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
throw p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public intercept(Lokhttp3/Interceptor$Chain;)Lokhttp3/Response;
|
|
|
|
.locals 6
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const/4 v0, 0x0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
if-eqz p1, :cond_4
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/discord/restapi/RequiredHeadersInterceptor;->headersProvider:Lcom/discord/restapi/RequiredHeadersInterceptor$HeadersProvider;
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-interface {v1}, Lcom/discord/restapi/RequiredHeadersInterceptor$HeadersProvider;->getAuthToken()Ljava/lang/String;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
iget-object v2, p0, Lcom/discord/restapi/RequiredHeadersInterceptor;->headersProvider:Lcom/discord/restapi/RequiredHeadersInterceptor$HeadersProvider;
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-interface {v2}, Lcom/discord/restapi/RequiredHeadersInterceptor$HeadersProvider;->getFingerprint()Ljava/lang/String;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
iget-object v3, p0, Lcom/discord/restapi/RequiredHeadersInterceptor;->headersProvider:Lcom/discord/restapi/RequiredHeadersInterceptor$HeadersProvider;
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-interface {v3}, Lcom/discord/restapi/RequiredHeadersInterceptor$HeadersProvider;->getLocale()Ljava/lang/String;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
iget-object v4, p0, Lcom/discord/restapi/RequiredHeadersInterceptor;->headersProvider:Lcom/discord/restapi/RequiredHeadersInterceptor$HeadersProvider;
|
|
|
|
|
|
|
|
invoke-interface {v4}, Lcom/discord/restapi/RequiredHeadersInterceptor$HeadersProvider;->getUserAgent()Ljava/lang/String;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
2020-07-14 22:43:59 +00:00
|
|
|
invoke-interface {p1}, Lokhttp3/Interceptor$Chain;->r()Lm0/a0;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
if-eqz v5, :cond_3
|
|
|
|
|
2020-07-14 22:43:59 +00:00
|
|
|
new-instance v0, Lm0/a0$a;
|
2020-07-08 16:44:49 +00:00
|
|
|
|
2020-07-14 22:43:59 +00:00
|
|
|
invoke-direct {v0, v5}, Lm0/a0$a;-><init>(Lm0/a0;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const-string v5, "User-Agent"
|
|
|
|
|
2020-07-14 22:43:59 +00:00
|
|
|
invoke-virtual {v0, v5, v4}, Lm0/a0$a;->a(Ljava/lang/String;Ljava/lang/String;)Lm0/a0$a;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
if-eqz v1, :cond_0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const-string v4, "Authorization"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-14 22:43:59 +00:00
|
|
|
invoke-virtual {v0, v4, v1}, Lm0/a0$a;->a(Ljava/lang/String;Ljava/lang/String;)Lm0/a0$a;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_0
|
2020-07-08 16:44:49 +00:00
|
|
|
if-eqz v2, :cond_1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const-string v1, "X-Fingerprint"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-14 22:43:59 +00:00
|
|
|
invoke-virtual {v0, v1, v2}, Lm0/a0$a;->a(Ljava/lang/String;Ljava/lang/String;)Lm0/a0$a;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_1
|
2020-07-08 16:44:49 +00:00
|
|
|
if-eqz v3, :cond_2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
const-string v1, "Accept-Language"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-14 22:43:59 +00:00
|
|
|
invoke-virtual {v0, v1, v3}, Lm0/a0$a;->a(Ljava/lang/String;Ljava/lang/String;)Lm0/a0$a;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_2
|
2020-07-14 22:43:59 +00:00
|
|
|
invoke-virtual {v0}, Lm0/a0$a;->b()Lm0/a0;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
2020-07-14 22:43:59 +00:00
|
|
|
invoke-interface {p1, v0}, Lokhttp3/Interceptor$Chain;->d(Lm0/a0;)Lokhttp3/Response;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
|
|
|
|
:cond_3
|
2020-07-08 16:44:49 +00:00
|
|
|
throw v0
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
:cond_4
|
|
|
|
const-string p1, "chain"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-14 22:43:59 +00:00
|
|
|
invoke-static {p1}, Li0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
throw v0
|
2020-05-17 12:40:10 +00:00
|
|
|
.end method
|