2020-05-17 12:40:10 +00:00
|
|
|
.class public final Lcom/discord/stores/StoreAuthentication$Companion;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "StoreAuthentication.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
|
|
value = Lcom/discord/stores/StoreAuthentication;
|
|
|
|
.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/stores/StoreAuthentication$Companion;-><init>()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$getDeviceEmail(Lcom/discord/stores/StoreAuthentication$Companion;Landroid/content/Context;)Ljava/lang/String;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreAuthentication$Companion;->getDeviceEmail(Landroid/content/Context;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final getDeviceEmail(Landroid/content/Context;)Ljava/lang/String;
|
|
|
|
.locals 6
|
|
|
|
|
|
|
|
const-string v0, "android.permission.GET_ACCOUNTS"
|
|
|
|
|
|
|
|
invoke-static {p1, v0}, Landroidx/core/content/ContextCompat;->checkSelfPermission(Landroid/content/Context;Ljava/lang/String;)I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
return-object v1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-static {p1}, Landroid/accounts/AccountManager;->get(Landroid/content/Context;)Landroid/accounts/AccountManager;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const-string v0, "AccountManager.get(context)"
|
|
|
|
|
2020-09-09 19:21:20 +00:00
|
|
|
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-virtual {p1}, Landroid/accounts/AccountManager;->getAccounts()[Landroid/accounts/Account;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const-string v0, "AccountManager.get(context).accounts"
|
|
|
|
|
2020-09-09 19:21:20 +00:00
|
|
|
invoke-static {p1, v0}, Lk0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
array-length v0, p1
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-ge v2, v0, :cond_2
|
|
|
|
|
|
|
|
aget-object v3, p1, v2
|
|
|
|
|
|
|
|
sget-object v4, Landroid/util/Patterns;->EMAIL_ADDRESS:Ljava/util/regex/Pattern;
|
|
|
|
|
|
|
|
iget-object v5, v3, Landroid/accounts/Account;->type:Ljava/lang/String;
|
|
|
|
|
|
|
|
invoke-virtual {v4, v5}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
invoke-virtual {v4}, Ljava/util/regex/Matcher;->matches()Z
|
|
|
|
|
|
|
|
move-result v4
|
|
|
|
|
|
|
|
if-eqz v4, :cond_1
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
move-object v3, v1
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
|
|
|
|
iget-object v1, v3, Landroid/accounts/Account;->name:Ljava/lang/String;
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
return-object v1
|
|
|
|
.end method
|