440 lines
9.8 KiB
Smali
440 lines
9.8 KiB
Smali
.class public final Lcom/discord/app/AppPermissions;
|
|
.super Ljava/lang/Object;
|
|
.source "AppPermissions.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/app/AppPermissions$Requests;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final c:Ljava/util/HashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/HashMap<",
|
|
"Ljava/lang/Integer;",
|
|
"[",
|
|
"Ljava/lang/String;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# instance fields
|
|
.field public final a:Ljava/util/HashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/HashMap<",
|
|
"Ljava/lang/Integer;",
|
|
"Lkotlin/jvm/functions/Function0<",
|
|
"Lkotlin/Unit;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final b:Landroidx/fragment/app/Fragment;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 5
|
|
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/app/AppPermissions;->c:Ljava/util/HashMap;
|
|
|
|
const/16 v1, 0xd3
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "android.permission.RECORD_AUDIO"
|
|
|
|
filled-new-array {v2}, [Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v0, v1, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
sget-object v0, Lcom/discord/app/AppPermissions;->c:Ljava/util/HashMap;
|
|
|
|
const/16 v1, 0xd2
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v3, "android.permission.CAMERA"
|
|
|
|
filled-new-array {v2, v3}, [Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
sget-object v0, Lcom/discord/app/AppPermissions;->c:Ljava/util/HashMap;
|
|
|
|
const/16 v1, 0xde
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "android.permission.READ_EXTERNAL_STORAGE"
|
|
|
|
const-string v4, "android.permission.WRITE_EXTERNAL_STORAGE"
|
|
|
|
filled-new-array {v3, v2, v4}, [Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
sget-object v0, Lcom/discord/app/AppPermissions;->c:Ljava/util/HashMap;
|
|
|
|
const/16 v1, 0xd5
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
filled-new-array {v4}, [Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
sget-object v0, Lcom/discord/app/AppPermissions;->c:Ljava/util/HashMap;
|
|
|
|
const/16 v1, 0xd6
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
filled-new-array {v3}, [Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroidx/fragment/app/Fragment;)V
|
|
.locals 1
|
|
|
|
const-string v0, "fragment"
|
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/app/AppPermissions;->b:Landroidx/fragment/app/Fragment;
|
|
|
|
new-instance p1, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p1}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/app/AppPermissions;->a:Ljava/util/HashMap;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic a(Lcom/discord/app/AppPermissions;[I)Z
|
|
.locals 0
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/app/AppPermissions;->b([I)Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final b([I)Z
|
|
.locals 5
|
|
|
|
array-length v0, p1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
const/4 v3, 0x1
|
|
|
|
if-ge v2, v0, :cond_2
|
|
|
|
aget v4, p1, v2
|
|
|
|
if-nez v4, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
const/4 v3, 0x0
|
|
|
|
:goto_1
|
|
if-nez v3, :cond_1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const/4 v1, 0x1
|
|
|
|
:goto_2
|
|
return v1
|
|
.end method
|
|
|
|
.method public final declared-synchronized c(I[I)V
|
|
.locals 3
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
const-string v0, "grantResults"
|
|
|
|
invoke-static {p2, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v0, Lcom/discord/app/AppPermissions$a;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/app/AppPermissions$a;-><init>(Lcom/discord/app/AppPermissions;)V
|
|
|
|
iget-object v1, p0, Lcom/discord/app/AppPermissions;->a:Ljava/util/HashMap;
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lkotlin/jvm/functions/Function0;
|
|
|
|
const/16 v2, 0xd2
|
|
|
|
if-eq p1, v2, :cond_4
|
|
|
|
const/16 v2, 0xd3
|
|
|
|
if-eq p1, v2, :cond_3
|
|
|
|
const/16 v2, 0xd5
|
|
|
|
if-eq p1, v2, :cond_2
|
|
|
|
const/16 v2, 0xd6
|
|
|
|
if-eq p1, v2, :cond_1
|
|
|
|
const/16 v2, 0xde
|
|
|
|
if-eq p1, v2, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
const p1, 0x7f12122e
|
|
|
|
new-instance v2, Lf/a/b/k;
|
|
|
|
invoke-direct {v2, v0, p1}, Lf/a/b/k;-><init>(Lcom/discord/app/AppPermissions$a;I)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const p1, 0x7f121235
|
|
|
|
new-instance v2, Lf/a/b/k;
|
|
|
|
invoke-direct {v2, v0, p1}, Lf/a/b/k;-><init>(Lcom/discord/app/AppPermissions$a;I)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const p1, 0x7f12122f
|
|
|
|
new-instance v2, Lf/a/b/k;
|
|
|
|
invoke-direct {v2, v0, p1}, Lf/a/b/k;-><init>(Lcom/discord/app/AppPermissions$a;I)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
const p1, 0x7f121230
|
|
|
|
new-instance v2, Lf/a/b/k;
|
|
|
|
invoke-direct {v2, v0, p1}, Lf/a/b/k;-><init>(Lcom/discord/app/AppPermissions$a;I)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
const p1, 0x7f12108a
|
|
|
|
new-instance v2, Lf/a/b/k;
|
|
|
|
invoke-direct {v2, v0, p1}, Lf/a/b/k;-><init>(Lcom/discord/app/AppPermissions$a;I)V
|
|
|
|
:goto_0
|
|
move-object p1, v2
|
|
|
|
:goto_1
|
|
new-instance v0, Landroid/os/Handler;
|
|
|
|
invoke-direct {v0}, Landroid/os/Handler;-><init>()V
|
|
|
|
new-instance v2, Lcom/discord/app/AppPermissions$b;
|
|
|
|
invoke-direct {v2, p0, p2, v1, p1}, Lcom/discord/app/AppPermissions$b;-><init>(Lcom/discord/app/AppPermissions;[ILkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)V
|
|
|
|
invoke-virtual {v0, v2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final declared-synchronized d(ILrx/functions/Action0;)V
|
|
.locals 6
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
new-instance v0, Lcom/discord/app/AppPermissions$c;
|
|
|
|
invoke-direct {v0, p2}, Lcom/discord/app/AppPermissions$c;-><init>(Lrx/functions/Action0;)V
|
|
|
|
sget-object p2, Lcom/discord/app/AppPermissions;->c:Ljava/util/HashMap;
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p2, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, [Ljava/lang/String;
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
const-string v1, "PERMISSION_GROUPS[requestCode] ?: return"
|
|
|
|
invoke-static {p2, v1}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iget-object v1, p0, Lcom/discord/app/AppPermissions;->b:Landroidx/fragment/app/Fragment;
|
|
|
|
invoke-virtual {v1}, Landroidx/fragment/app/Fragment;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
new-instance v2, Ljava/util/ArrayList;
|
|
|
|
array-length v3, p2
|
|
|
|
invoke-direct {v2, v3}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
array-length v3, p2
|
|
|
|
const/4 v4, 0x0
|
|
|
|
:goto_0
|
|
if-ge v4, v3, :cond_0
|
|
|
|
aget-object v5, p2, v4
|
|
|
|
invoke-static {v1, v5}, Landroidx/core/content/ContextCompat;->checkSelfPermission(Landroid/content/Context;Ljava/lang/String;)I
|
|
|
|
move-result v5
|
|
|
|
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v2, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 v4, v4, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-static {v2}, Lc0/i/f;->toIntArray(Ljava/util/Collection;)[I
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p0, v1}, Lcom/discord/app/AppPermissions;->b([I)Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-ne v1, v2, :cond_1
|
|
|
|
invoke-interface {v0}, Lkotlin/jvm/functions/Function0;->invoke()Ljava/lang/Object;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
iget-object v1, p0, Lcom/discord/app/AppPermissions;->a:Ljava/util/HashMap;
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v1, v2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
iget-object v0, p0, Lcom/discord/app/AppPermissions;->b:Landroidx/fragment/app/Fragment;
|
|
|
|
invoke-virtual {v0, p2, p1}, Landroidx/fragment/app/Fragment;->requestPermissions([Ljava/lang/String;I)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:goto_1
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|