308 lines
8 KiB
Smali
308 lines
8 KiB
Smali
.class public final Lcom/discord/widgets/auth/WidgetOauth2Authorize$Companion;
|
|
.super Ljava/lang/Object;
|
|
.source "WidgetOauth2Authorize.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/widgets/auth/WidgetOauth2Authorize;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "Companion"
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/auth/WidgetOauth2Authorize$Companion;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$createOauthAuthorize(Lcom/discord/widgets/auth/WidgetOauth2Authorize$Companion;Landroid/net/Uri;)Lcom/discord/widgets/auth/WidgetOauth2Authorize$OAuth2Authorize;
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/auth/WidgetOauth2Authorize$Companion;->createOauthAuthorize(Landroid/net/Uri;)Lcom/discord/widgets/auth/WidgetOauth2Authorize$OAuth2Authorize;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final createLaunchIntent(Landroid/net/Uri;Lcom/discord/widgets/auth/WidgetOauth2Authorize$OAuth2Authorize;)Landroid/content/Intent;
|
|
.locals 2
|
|
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-string v1, "android.intent.action.VIEW"
|
|
|
|
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string v1, "REQ_URI"
|
|
|
|
invoke-virtual {v0, v1, p1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
|
|
|
|
invoke-virtual {p2}, Lcom/discord/widgets/auth/WidgetOauth2Authorize$OAuth2Authorize;->getInternalReferrer()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-static {p1}, Ljava/lang/Boolean;->parseBoolean(Ljava/lang/String;)Z
|
|
|
|
move-result p1
|
|
|
|
const/4 p2, 0x1
|
|
|
|
if-eq p1, p2, :cond_1
|
|
|
|
:cond_0
|
|
const p1, 0x10008000
|
|
|
|
invoke-virtual {v0, p1}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;
|
|
|
|
:cond_1
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final createOauthAuthorize(Landroid/net/Uri;)Lcom/discord/widgets/auth/WidgetOauth2Authorize$OAuth2Authorize;
|
|
.locals 16
|
|
|
|
move-object/from16 v0, p1
|
|
|
|
sget-object v1, Lcom/discord/widgets/auth/WidgetOauth2Authorize$Companion$createOauthAuthorize$1;->INSTANCE:Lcom/discord/widgets/auth/WidgetOauth2Authorize$Companion$createOauthAuthorize$1;
|
|
|
|
new-instance v15, Lcom/discord/widgets/auth/WidgetOauth2Authorize$OAuth2Authorize;
|
|
|
|
const-string v2, "client_id"
|
|
|
|
invoke-virtual {v1, v0, v2}, Lcom/discord/widgets/auth/WidgetOauth2Authorize$Companion$createOauthAuthorize$1;->invoke(Landroid/net/Uri;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
const-string v2, "redirect_uri"
|
|
|
|
invoke-virtual {v0, v2}, Landroid/net/Uri;->getQueryParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
const-string v2, "response_type"
|
|
|
|
invoke-virtual {v0, v2}, Landroid/net/Uri;->getQueryParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
const-string v2, "state"
|
|
|
|
invoke-virtual {v0, v2}, Landroid/net/Uri;->getQueryParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
const-string v2, "scope"
|
|
|
|
invoke-virtual {v1, v0, v2}, Lcom/discord/widgets/auth/WidgetOauth2Authorize$Companion$createOauthAuthorize$1;->invoke(Landroid/net/Uri;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v8
|
|
|
|
const-string v1, "permissions"
|
|
|
|
invoke-virtual {v0, v1}, Landroid/net/Uri;->getQueryParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v9
|
|
|
|
const-string v1, "code_challenge"
|
|
|
|
invoke-virtual {v0, v1}, Landroid/net/Uri;->getQueryParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v10
|
|
|
|
const-string v1, "code_challenge_method"
|
|
|
|
invoke-virtual {v0, v1}, Landroid/net/Uri;->getQueryParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v11
|
|
|
|
const-string v1, "internal_referrer"
|
|
|
|
invoke-virtual {v0, v1}, Landroid/net/Uri;->getQueryParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v12
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/16 v13, 0x10
|
|
|
|
const/4 v14, 0x0
|
|
|
|
move-object v2, v15
|
|
|
|
invoke-direct/range {v2 .. v14}, Lcom/discord/widgets/auth/WidgetOauth2Authorize$OAuth2Authorize;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
return-object v15
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getNoticeName(Ljava/lang/String;)Ljava/lang/String;
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const-string v0, "OAUTH_REQUEST:"
|
|
|
|
invoke-static {v0, p1}, Lf/e/b/a/a;->p(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
const-string p1, "clientId"
|
|
|
|
invoke-static {p1}, Li0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final launch(Landroid/content/Context;Landroid/net/Uri;)V
|
|
.locals 5
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
if-eqz p2, :cond_5
|
|
|
|
:try_start_0
|
|
invoke-direct {p0, p2}, Lcom/discord/widgets/auth/WidgetOauth2Authorize$Companion;->createOauthAuthorize(Landroid/net/Uri;)Lcom/discord/widgets/auth/WidgetOauth2Authorize$OAuth2Authorize;
|
|
|
|
move-result-object v0
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
nop
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_4
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/auth/WidgetOauth2Authorize$OAuth2Authorize;->getClientId()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
sget-object v2, Lcom/discord/utilities/analytics/AnalyticsTracker;->INSTANCE:Lcom/discord/utilities/analytics/AnalyticsTracker;
|
|
|
|
invoke-static {v1}, Li0/t/j;->toLongOrNull(Ljava/lang/String;)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
const-wide/16 v3, 0x0
|
|
|
|
:goto_1
|
|
invoke-virtual {v2, v3, v4}, Lcom/discord/utilities/analytics/AnalyticsTracker;->oauth2AuthorizedViewed(J)V
|
|
|
|
const-string v2, "591317049637339146"
|
|
|
|
invoke-static {v1, v2}, Li0/n/c/h;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v4, 0x1c
|
|
|
|
if-lt v1, v4, :cond_1
|
|
|
|
sget-object v1, Landroid/os/Build;->MANUFACTURER:Ljava/lang/String;
|
|
|
|
const-string v4, "samsung"
|
|
|
|
invoke-static {v1, v4, v2}, Li0/t/k;->equals(Ljava/lang/String;Ljava/lang/String;Z)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
const/4 v1, 0x0
|
|
|
|
:goto_2
|
|
if-eqz v1, :cond_2
|
|
|
|
goto :goto_3
|
|
|
|
:cond_2
|
|
const/4 v2, 0x0
|
|
|
|
:goto_3
|
|
if-eqz v2, :cond_3
|
|
|
|
const-class v1, Lcom/discord/widgets/auth/WidgetOauth2AuthorizeSamsung;
|
|
|
|
goto :goto_4
|
|
|
|
:cond_3
|
|
const-class v1, Lcom/discord/widgets/auth/WidgetOauth2Authorize;
|
|
|
|
:goto_4
|
|
invoke-direct {p0, p2, v0}, Lcom/discord/widgets/auth/WidgetOauth2Authorize$Companion;->createLaunchIntent(Landroid/net/Uri;Lcom/discord/widgets/auth/WidgetOauth2Authorize$OAuth2Authorize;)Landroid/content/Intent;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-static {p1, v1, p2}, Lf/a/b/m;->e(Landroid/content/Context;Ljava/lang/Class;Landroid/content/Intent;)V
|
|
|
|
:cond_4
|
|
return-void
|
|
|
|
:cond_5
|
|
const-string p1, "requestUri"
|
|
|
|
invoke-static {p1}, Li0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_6
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Li0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|