945 lines
30 KiB
Smali
945 lines
30 KiB
Smali
.class public final Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;
|
|
.super Lcom/discord/widgets/auth/WidgetOauthAuthorize;
|
|
.source "WidgetOauthAuthorizeSamsung.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$Companion;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field static final synthetic $$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
.field public static final Companion:Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$Companion;
|
|
|
|
.field private static final REQ_CODE_SAMSUNG:I = 0x1553
|
|
|
|
.field private static final REQ_CODE_SAMSUNG_DISCLAIMER:I = 0x1552
|
|
|
|
|
|
# instance fields
|
|
.field private final grantBtn$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
.field private samsungAuthCode:Ljava/lang/String;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 5
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [Lkotlin/reflect/KProperty;
|
|
|
|
new-instance v1, Lkotlin/jvm/internal/v;
|
|
|
|
const-class v2, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;
|
|
|
|
invoke-static {v2}, Lkotlin/jvm/internal/w;->Q(Ljava/lang/Class;)Lkotlin/reflect/b;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "grantBtn"
|
|
|
|
const-string v4, "getGrantBtn()Landroid/widget/Button;"
|
|
|
|
invoke-direct {v1, v2, v3, v4}, Lkotlin/jvm/internal/v;-><init>(Lkotlin/reflect/KDeclarationContainer;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-static {v1}, Lkotlin/jvm/internal/w;->a(Lkotlin/jvm/internal/u;)Lkotlin/reflect/d;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
sput-object v0, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
new-instance v0, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sput-object v0, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->Companion:Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$Companion;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/auth/WidgetOauthAuthorize;-><init>()V
|
|
|
|
const v0, 0x7f0a04a9
|
|
|
|
invoke-static {p0, v0}, Lkotterknife/b;->c(Landroidx/fragment/app/Fragment;I)Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->grantBtn$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$authorizeForSamsung(Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;Ljava/lang/String;Ljava/lang/String;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->authorizeForSamsung(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$checkDisclaimer(Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->checkDisclaimer()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$getSamsungAuthCode$p(Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;)Ljava/lang/String;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->samsungAuthCode:Ljava/lang/String;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$setSamsungAuthCode$p(Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;Ljava/lang/String;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->samsungAuthCode:Ljava/lang/String;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final authorizeForSamsung(Ljava/lang/String;Ljava/lang/String;)V
|
|
.locals 12
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->getOauthViewModel()Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthViewModel;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthViewModel;->getOauthAuthorize()Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthAuthorize;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p2}, Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthAuthorize;->post(Ljava/lang/String;)Lrx/Observable;
|
|
|
|
move-result-object p2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-static {p2, v1, v2, v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object p2
|
|
|
|
move-object v1, p0
|
|
|
|
check-cast v1, Lcom/discord/app/AppComponent;
|
|
|
|
const/4 v2, 0x2
|
|
|
|
invoke-static {p2, v1, v0, v2, v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v4
|
|
|
|
new-instance p2, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$authorizeForSamsung$1;
|
|
|
|
invoke-direct {p2, p0}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$authorizeForSamsung$1;-><init>(Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;)V
|
|
|
|
move-object v7, p2
|
|
|
|
check-cast v7, Lkotlin/jvm/functions/Function1;
|
|
|
|
new-instance p2, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$authorizeForSamsung$2;
|
|
|
|
invoke-direct {p2, p0, p1}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$authorizeForSamsung$2;-><init>(Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;Ljava/lang/String;)V
|
|
|
|
move-object v9, p2
|
|
|
|
check-cast v9, Lkotlin/jvm/functions/Function1;
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/16 v10, 0x16
|
|
|
|
const/4 v11, 0x0
|
|
|
|
invoke-static/range {v3 .. v11}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final checkDisclaimer()V
|
|
.locals 3
|
|
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-string v1, "com.msc.action.samsungaccount.REQUEST_NEW_THIRD_PARTY_INTEGRATION_WITH_SAMSUNG_ACCOUNT"
|
|
|
|
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string v1, "client_id"
|
|
|
|
const-string v2, "97t47j218f"
|
|
|
|
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
const-string v1, "progress_theme"
|
|
|
|
const-string v2, "dark"
|
|
|
|
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
const/16 v1, 0x1552
|
|
|
|
invoke-virtual {p0, v0, v1}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->startActivityForResult(Landroid/content/Intent;I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getGrantBtn()Landroid/widget/Button;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->grantBtn$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
sget-object v1, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aget-object v1, v1, v2
|
|
|
|
invoke-interface {v0, p0, v1}, Lkotlin/properties/ReadOnlyProperty;->getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/widget/Button;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final startSamsungAccountLink(Ljava/lang/String;Ljava/lang/String;)V
|
|
.locals 12
|
|
|
|
sget-object v0, Lcom/discord/samsung/a;->zP:Lcom/discord/samsung/a;
|
|
|
|
invoke-static {p1}, Lcom/discord/samsung/a;->ai(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "Samsung GET /authorize "
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lcom/discord/app/AppLog;->i(Ljava/lang/String;)V
|
|
|
|
sget-object v0, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->Companion:Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$Companion;
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->getOauthViewModel()Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthViewModel;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthViewModel;->getOauthAuthorize()Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthAuthorize;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1, p1}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$Companion;->getForSamsung(Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthAuthorize;Ljava/lang/String;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-static {p1, v1, v2, v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
move-object v1, p0
|
|
|
|
check-cast v1, Lcom/discord/app/AppComponent;
|
|
|
|
const/4 v2, 0x2
|
|
|
|
invoke-static {p1, v1, v0, v2, v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->requireContext()Landroid/content/Context;
|
|
|
|
move-result-object v5
|
|
|
|
new-instance p1, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$startSamsungAccountLink$1;
|
|
|
|
invoke-direct {p1, p0}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$startSamsungAccountLink$1;-><init>(Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;)V
|
|
|
|
move-object v7, p1
|
|
|
|
check-cast v7, Lkotlin/jvm/functions/Function1;
|
|
|
|
new-instance p1, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$startSamsungAccountLink$2;
|
|
|
|
invoke-direct {p1, p0, p2}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$startSamsungAccountLink$2;-><init>(Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;Ljava/lang/String;)V
|
|
|
|
move-object v9, p1
|
|
|
|
check-cast v9, Lkotlin/jvm/functions/Function1;
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/16 v10, 0x14
|
|
|
|
const/4 v11, 0x0
|
|
|
|
invoke-static/range {v3 .. v11}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method protected final configureUI(Lcom/discord/restapi/RestAPIParams$OAuthAuthorize$ResponseGet;)V
|
|
.locals 1
|
|
|
|
const-string v0, "data"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-super {p0, p1}, Lcom/discord/widgets/auth/WidgetOauthAuthorize;->configureUI(Lcom/discord/restapi/RestAPIParams$OAuthAuthorize$ResponseGet;)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->getGrantBtn()Landroid/widget/Button;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$configureUI$1;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$configureUI$1;-><init>(Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;)V
|
|
|
|
check-cast v0, Landroid/view/View$OnClickListener;
|
|
|
|
invoke-virtual {p1, v0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method protected final createOauthAuthorize(Landroid/net/Uri;)Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthAuthorize;
|
|
.locals 11
|
|
|
|
const-string v0, "requestUrl"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-super {p0, p1}, Lcom/discord/widgets/auth/WidgetOauthAuthorize;->createOauthAuthorize(Landroid/net/Uri;)Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthAuthorize;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const-string v5, "https://discordapp.com/api/v6/oauth2/samsung/authorize/callback"
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/16 v9, 0x77
|
|
|
|
const/4 v10, 0x0
|
|
|
|
invoke-static/range {v1 .. v10}, Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthAuthorize;->copy$default(Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthAuthorize;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthAuthorize;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final getContentViewResId()I
|
|
.locals 1
|
|
|
|
const v0, 0x7f0d015a
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final onActivityResult(IILandroid/content/Intent;)V
|
|
.locals 5
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "SamsungOauth onActivityResult "
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, ", "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lcom/discord/app/AppLog;->i(Ljava/lang/String;)V
|
|
|
|
const/16 v0, 0x1552
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/16 v2, 0x1553
|
|
|
|
const/4 v3, 0x2
|
|
|
|
const/4 v4, 0x0
|
|
|
|
if-eq p1, v0, :cond_6
|
|
|
|
if-eq p1, v2, :cond_1
|
|
|
|
sget-object v0, Lcom/discord/widgets/auth/WidgetAuthCaptcha;->Companion:Lcom/discord/widgets/auth/WidgetAuthCaptcha$Companion;
|
|
|
|
new-instance v1, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$onActivityResult$isCaptchaHandled$1;
|
|
|
|
invoke-direct {v1, p0}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$onActivityResult$isCaptchaHandled$1;-><init>(Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;)V
|
|
|
|
check-cast v1, Lkotlin/jvm/functions/Function1;
|
|
|
|
invoke-virtual {v0, p2, p3, v1}, Lcom/discord/widgets/auth/WidgetAuthCaptcha$Companion;->handleResult(ILandroid/content/Intent;Lkotlin/jvm/functions/Function1;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-super {p0, p1, p2, p3}, Lcom/discord/widgets/auth/WidgetOauthAuthorize;->onActivityResult(IILandroid/content/Intent;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
:cond_1
|
|
const/16 p1, 0x1f4
|
|
|
|
if-ne p2, p1, :cond_4
|
|
|
|
sget-object p1, Lcom/discord/app/AppLog;->uC:Lcom/discord/app/AppLog;
|
|
|
|
const-string p2, "Samsung connection requires SA service, but something went wrong."
|
|
|
|
invoke-static {p1, p2, v4, v3, v4}, Lcom/discord/utilities/logging/Logger;->w$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)V
|
|
|
|
if-eqz p3, :cond_2
|
|
|
|
const-string p1, "com.discord.samsung.intent.extra.ATTEMPT_COUNT"
|
|
|
|
invoke-virtual {p3, p1, v1}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
|
|
|
|
move-result v1
|
|
|
|
:cond_2
|
|
if-ge v1, v3, :cond_3
|
|
|
|
sget-object p1, Lcom/discord/app/AppLog;->uC:Lcom/discord/app/AppLog;
|
|
|
|
const-string p2, "Samsung retrying SA connection.\nBecause sometimes it just doesn\'t bind the first time."
|
|
|
|
invoke-static {p1, p2, v4, v3, v4}, Lcom/discord/utilities/logging/Logger;->w$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)V
|
|
|
|
sget-object p1, Lcom/discord/samsung/SamsungConnectActivity;->zT:Lcom/discord/samsung/SamsungConnectActivity$a;
|
|
|
|
move-object p1, p0
|
|
|
|
check-cast p1, Landroidx/fragment/app/Fragment;
|
|
|
|
invoke-static {p1, v2, v1}, Lcom/discord/samsung/SamsungConnectActivity$a;->a(Landroidx/fragment/app/Fragment;II)V
|
|
|
|
:cond_3
|
|
return-void
|
|
|
|
:cond_4
|
|
if-eqz p3, :cond_5
|
|
|
|
new-instance p1, Lkotlin/Pair;
|
|
|
|
const-string p2, "SAMSUNG_REQ_AUTH_PARAM_AUTHCODE"
|
|
|
|
invoke-virtual {p3, p2}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
const-string v0, "SAMSUNG_REQ_AUTH_PARAM_AUTH_SERVER_URL"
|
|
|
|
invoke-virtual {p3, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-direct {p1, p2, p3}, Lkotlin/Pair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
|
|
iget-object p2, p1, Lkotlin/Pair;->first:Ljava/lang/Object;
|
|
|
|
check-cast p2, Ljava/lang/String;
|
|
|
|
iget-object p1, p1, Lkotlin/Pair;->second:Ljava/lang/Object;
|
|
|
|
check-cast p1, Ljava/lang/String;
|
|
|
|
iput-object p2, p0, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->samsungAuthCode:Ljava/lang/String;
|
|
|
|
const-string p3, "saUrl"
|
|
|
|
invoke-static {p1, p3}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string p3, "authCode"
|
|
|
|
invoke-static {p2, p3}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->startSamsungAccountLink(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
:cond_5
|
|
sget-object p1, Lcom/discord/app/AppLog;->uC:Lcom/discord/app/AppLog;
|
|
|
|
const-string p2, "Samsung auth code not sent"
|
|
|
|
invoke-static {p1, p2, v4, v3, v4}, Lcom/discord/utilities/logging/Logger;->w$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
|
|
:cond_6
|
|
const/4 p1, -0x1
|
|
|
|
if-ne p2, p1, :cond_7
|
|
|
|
const-string p1, "Samsung disclaimer accepted"
|
|
|
|
invoke-static {p1}, Lcom/discord/app/AppLog;->i(Ljava/lang/String;)V
|
|
|
|
sget-object p1, Lcom/discord/samsung/SamsungConnectActivity;->zT:Lcom/discord/samsung/SamsungConnectActivity$a;
|
|
|
|
move-object p1, p0
|
|
|
|
check-cast p1, Landroidx/fragment/app/Fragment;
|
|
|
|
invoke-static {p1, v2, v1}, Lcom/discord/samsung/SamsungConnectActivity$a;->a(Landroidx/fragment/app/Fragment;II)V
|
|
|
|
return-void
|
|
|
|
:cond_7
|
|
if-eqz p3, :cond_8
|
|
|
|
invoke-virtual {p3}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_8
|
|
|
|
const-string p2, "error_message"
|
|
|
|
invoke-virtual {p1, p2}, Landroid/os/Bundle;->get(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_8
|
|
move-object p1, v4
|
|
|
|
:goto_0
|
|
if-eqz p3, :cond_9
|
|
|
|
invoke-virtual {p3}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
|
|
|
|
move-result-object p2
|
|
|
|
if-eqz p2, :cond_9
|
|
|
|
const-string p3, "error_code"
|
|
|
|
invoke-virtual {p2, p3}, Landroid/os/Bundle;->get(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_9
|
|
move-object p2, v4
|
|
|
|
:goto_1
|
|
sget-object p3, Lcom/discord/app/AppLog;->uC:Lcom/discord/app/AppLog;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "Samsung connection requires disclaimer acceptance. ["
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p2, "] "
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p3, p1, v4, v3, v4}, Lcom/discord/utilities/logging/Logger;->w$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)V
|
|
|
|
invoke-virtual {p0}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->getAppActivity()Lcom/discord/app/AppActivity;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_a
|
|
|
|
invoke-virtual {p1}, Lcom/discord/app/AppActivity;->finish()V
|
|
|
|
:cond_a
|
|
return-void
|
|
.end method
|
|
|
|
.method final synthetic samsungCallbackHandshake(Ljava/lang/String;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
|
.locals 19
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/String;",
|
|
"Lkotlin/coroutines/Continuation<",
|
|
"-",
|
|
"Lkotlin/Unit;",
|
|
">;)",
|
|
"Ljava/lang/Object;"
|
|
}
|
|
.end annotation
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
move-object/from16 v1, p1
|
|
|
|
move-object/from16 v2, p3
|
|
|
|
instance-of v3, v2, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
move-object v3, v2
|
|
|
|
check-cast v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;
|
|
|
|
iget v4, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->label:I
|
|
|
|
const/high16 v5, -0x80000000
|
|
|
|
and-int/2addr v4, v5
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
iget v2, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->label:I
|
|
|
|
sub-int/2addr v2, v5
|
|
|
|
iput v2, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->label:I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;
|
|
|
|
invoke-direct {v3, v0, v2}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;-><init>(Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;Lkotlin/coroutines/Continuation;)V
|
|
|
|
:goto_0
|
|
iget-object v2, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->result:Ljava/lang/Object;
|
|
|
|
sget-object v4, Lkotlin/coroutines/a/a;->bkm:Lkotlin/coroutines/a/a;
|
|
|
|
iget v5, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->label:I
|
|
|
|
const-string v6, "client"
|
|
|
|
const/4 v7, 0x1
|
|
|
|
const/4 v8, 0x2
|
|
|
|
if-eqz v5, :cond_3
|
|
|
|
if-eq v5, v7, :cond_2
|
|
|
|
if-ne v5, v8, :cond_1
|
|
|
|
iget-object v1, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$0:Ljava/lang/Object;
|
|
|
|
check-cast v1, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;
|
|
|
|
goto/16 :goto_2
|
|
|
|
:cond_1
|
|
new-instance v1, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v2, "call to \'resume\' before \'invoke\' with coroutine"
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
|
|
:cond_2
|
|
iget-object v1, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$3:Ljava/lang/Object;
|
|
|
|
check-cast v1, Lokhttp3/t;
|
|
|
|
iget-object v5, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$2:Ljava/lang/Object;
|
|
|
|
check-cast v5, Ljava/lang/String;
|
|
|
|
iget-object v7, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$1:Ljava/lang/Object;
|
|
|
|
check-cast v7, Ljava/lang/String;
|
|
|
|
iget-object v9, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$0:Ljava/lang/Object;
|
|
|
|
check-cast v9, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
new-instance v2, Lokhttp3/t$a;
|
|
|
|
invoke-direct {v2}, Lokhttp3/t$a;-><init>()V
|
|
|
|
invoke-virtual {v2}, Lokhttp3/t$a;->GR()Lokhttp3/t$a;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2}, Lokhttp3/t$a;->GS()Lokhttp3/t;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v5, "Samsung GET /callback"
|
|
|
|
invoke-static {v5}, Lcom/discord/app/AppLog;->i(Ljava/lang/String;)V
|
|
|
|
sget-object v5, Lcom/discord/samsung/a;->zP:Lcom/discord/samsung/a;
|
|
|
|
invoke-static {v2, v6}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iput-object v0, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$0:Ljava/lang/Object;
|
|
|
|
iput-object v1, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$1:Ljava/lang/Object;
|
|
|
|
move-object/from16 v5, p2
|
|
|
|
iput-object v5, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$2:Ljava/lang/Object;
|
|
|
|
iput-object v2, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$3:Ljava/lang/Object;
|
|
|
|
iput v7, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->label:I
|
|
|
|
invoke-static {v2, v1, v3}, Lcom/discord/samsung/a;->a(Lokhttp3/t;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
|
|
|
move-result-object v7
|
|
|
|
if-ne v7, v4, :cond_4
|
|
|
|
return-object v4
|
|
|
|
:cond_4
|
|
move-object v9, v0
|
|
|
|
move-object/from16 v18, v7
|
|
|
|
move-object v7, v1
|
|
|
|
move-object v1, v2
|
|
|
|
move-object/from16 v2, v18
|
|
|
|
:goto_1
|
|
check-cast v2, Landroid/net/Uri;
|
|
|
|
if-eqz v2, :cond_7
|
|
|
|
const-string v10, "redirect_uri"
|
|
|
|
invoke-virtual {v2, v10}, Landroid/net/Uri;->getQueryParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v10
|
|
|
|
if-eqz v10, :cond_7
|
|
|
|
invoke-static {v10}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v11
|
|
|
|
const-string v12, "Samsung POST /callback "
|
|
|
|
invoke-virtual {v12, v11}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-static {v11}, Lcom/discord/app/AppLog;->i(Ljava/lang/String;)V
|
|
|
|
sget-object v11, Lcom/discord/samsung/a;->zP:Lcom/discord/samsung/a;
|
|
|
|
invoke-static {v1, v6}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v9}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;->getOauthViewModel()Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthViewModel;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-virtual {v6}, Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthViewModel;->getOauthAuthorize()Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthAuthorize;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-virtual {v6}, Lcom/discord/widgets/auth/WidgetOauthAuthorize$OAuthAuthorize;->getState()Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
if-nez v6, :cond_5
|
|
|
|
invoke-static {}, Lkotlin/jvm/internal/k;->Em()V
|
|
|
|
:cond_5
|
|
iput-object v9, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$0:Ljava/lang/Object;
|
|
|
|
iput-object v7, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$1:Ljava/lang/Object;
|
|
|
|
iput-object v5, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$2:Ljava/lang/Object;
|
|
|
|
iput-object v1, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$3:Ljava/lang/Object;
|
|
|
|
iput-object v2, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$4:Ljava/lang/Object;
|
|
|
|
iput-object v10, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->L$5:Ljava/lang/Object;
|
|
|
|
iput v8, v3, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$1;->label:I
|
|
|
|
invoke-static {v1, v10, v6, v5, v3}, Lcom/discord/samsung/a;->a(Lokhttp3/t;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
if-ne v2, v4, :cond_6
|
|
|
|
return-object v4
|
|
|
|
:cond_6
|
|
move-object v1, v9
|
|
|
|
:goto_2
|
|
check-cast v2, Landroid/net/Uri;
|
|
|
|
invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "Samsung POST /callback success "
|
|
|
|
invoke-virtual {v3, v2}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v2}, Lcom/discord/app/AppLog;->i(Ljava/lang/String;)V
|
|
|
|
sget-object v2, Lkotlin/Unit;->bjG:Lkotlin/Unit;
|
|
|
|
invoke-static {v2}, Lrx/Observable;->bI(Ljava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "Observable\n .just(Unit)"
|
|
|
|
invoke-static {v2, v3}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
move-object v3, v1
|
|
|
|
check-cast v3, Lcom/discord/app/AppComponent;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
invoke-static {v2, v3, v4, v8, v4}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v9
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v10
|
|
|
|
const/4 v11, 0x0
|
|
|
|
const/4 v12, 0x0
|
|
|
|
const/4 v13, 0x0
|
|
|
|
const/4 v14, 0x0
|
|
|
|
new-instance v2, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$2;
|
|
|
|
invoke-direct {v2, v1}, Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung$samsungCallbackHandshake$2;-><init>(Lcom/discord/widgets/auth/WidgetOauthAuthorizeSamsung;)V
|
|
|
|
move-object v15, v2
|
|
|
|
check-cast v15, Lkotlin/jvm/functions/Function1;
|
|
|
|
const/16 v16, 0x1e
|
|
|
|
const/16 v17, 0x0
|
|
|
|
invoke-static/range {v9 .. v17}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
|
|
|
|
sget-object v1, Lkotlin/Unit;->bjG:Lkotlin/Unit;
|
|
|
|
return-object v1
|
|
|
|
:cond_7
|
|
new-instance v1, Lcom/discord/samsung/a$a;
|
|
|
|
const-string v2, "no_redirect_uri"
|
|
|
|
const-string v3, "no redirect uri returned from GET/callback"
|
|
|
|
invoke-direct {v1, v2, v3}, Lcom/discord/samsung/a$a;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
check-cast v1, Ljava/lang/Throwable;
|
|
|
|
throw v1
|
|
.end method
|