617 lines
15 KiB
Smali
617 lines
15 KiB
Smali
.class final Lcom/ph/permissions/PermissionSettingPage;
|
|
.super Ljava/lang/Object;
|
|
.source "PermissionSettingPage.java"
|
|
|
|
|
|
# direct methods
|
|
.method constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 16
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static getApplicationDetailsIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
.locals 3
|
|
|
|
.line 79
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-string v1, "android.settings.APPLICATION_DETAILS_SETTINGS"
|
|
|
|
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 80
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "package:"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v0, p0}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method static getInstallPermissionIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
.locals 3
|
|
|
|
.line 89
|
|
invoke-static {}, Lcom/ph/permissions/PermissionUtils;->isAndroid8()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 90
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-string v1, "android.settings.MANAGE_UNKNOWN_APP_SOURCES"
|
|
|
|
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 91
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "package:"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 93
|
|
invoke-static {p0, v0}, Lcom/ph/permissions/PermissionUtils;->hasActivityIntent(Landroid/content/Context;Landroid/content/Intent;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
.line 94
|
|
:cond_1
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getApplicationDetailsIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method static getNotifyPermissionIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
.locals 3
|
|
|
|
.line 120
|
|
invoke-static {}, Lcom/ph/permissions/PermissionUtils;->isAndroid8()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 121
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-string v1, "android.settings.APP_NOTIFICATION_SETTINGS"
|
|
|
|
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 122
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "android.provider.extra.APP_PACKAGE"
|
|
|
|
invoke-virtual {v0, v2, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 125
|
|
invoke-static {p0, v0}, Lcom/ph/permissions/PermissionUtils;->hasActivityIntent(Landroid/content/Context;Landroid/content/Intent;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
.line 126
|
|
:cond_1
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getApplicationDetailsIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method static getSettingPermissionIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
.locals 3
|
|
|
|
.line 136
|
|
invoke-static {}, Lcom/ph/permissions/PermissionUtils;->isAndroid6()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 137
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-string v1, "android.settings.action.MANAGE_WRITE_SETTINGS"
|
|
|
|
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 138
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "package:"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 140
|
|
invoke-static {p0, v0}, Lcom/ph/permissions/PermissionUtils;->hasActivityIntent(Landroid/content/Context;Landroid/content/Intent;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
.line 141
|
|
:cond_1
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getApplicationDetailsIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method static getSmartPermissionIntent(Landroid/content/Context;Ljava/util/List;)Landroid/content/Intent;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/content/Context;",
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/String;",
|
|
">;)",
|
|
"Landroid/content/Intent;"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_a
|
|
|
|
.line 22
|
|
invoke-interface {p1}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto/16 :goto_0
|
|
|
|
.line 27
|
|
:cond_0
|
|
invoke-static {p1}, Lcom/ph/permissions/PermissionUtils;->containsSpecialPermission(Ljava/util/List;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_9
|
|
|
|
.line 29
|
|
invoke-interface {p1}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const-string v2, "android.permission.MANAGE_EXTERNAL_STORAGE"
|
|
|
|
if-ne v0, v1, :cond_6
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 31
|
|
invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Ljava/lang/String;
|
|
|
|
.line 32
|
|
invoke-virtual {v2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 33
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getStoragePermissionIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_1
|
|
const-string v0, "android.permission.REQUEST_INSTALL_PACKAGES"
|
|
|
|
.line 36
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 37
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getInstallPermissionIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_2
|
|
const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
|
|
|
|
.line 40
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
.line 41
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getWindowPermissionIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_3
|
|
const-string v0, "android.permission.ACCESS_NOTIFICATION_POLICY"
|
|
|
|
.line 44
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
.line 45
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getNotifyPermissionIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_4
|
|
const-string v0, "android.permission.WRITE_SETTINGS"
|
|
|
|
.line 48
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
.line 49
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getSettingPermissionIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 52
|
|
:cond_5
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getApplicationDetailsIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 55
|
|
:cond_6
|
|
invoke-interface {p1}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x3
|
|
|
|
if-ne v0, v1, :cond_8
|
|
|
|
.line 57
|
|
invoke-interface {p1, v2}, Ljava/util/List;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_8
|
|
|
|
const-string v0, "android.permission.READ_EXTERNAL_STORAGE"
|
|
|
|
.line 58
|
|
invoke-interface {p1, v0}, Ljava/util/List;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_8
|
|
|
|
const-string v0, "android.permission.WRITE_EXTERNAL_STORAGE"
|
|
|
|
.line 59
|
|
invoke-interface {p1, v0}, Ljava/util/List;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_8
|
|
|
|
.line 61
|
|
invoke-static {}, Lcom/ph/permissions/PermissionUtils;->isAndroid11()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_7
|
|
|
|
.line 62
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getStoragePermissionIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 65
|
|
:cond_7
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getApplicationDetailsIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 69
|
|
:cond_8
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getApplicationDetailsIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 72
|
|
:cond_9
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getApplicationDetailsIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 23
|
|
:cond_a
|
|
:goto_0
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getApplicationDetailsIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method static getStoragePermissionIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
.locals 3
|
|
|
|
.line 151
|
|
invoke-static {}, Lcom/ph/permissions/PermissionUtils;->isAndroid11()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 152
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-string v1, "android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION"
|
|
|
|
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 153
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "package:"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 155
|
|
invoke-static {p0, v0}, Lcom/ph/permissions/PermissionUtils;->hasActivityIntent(Landroid/content/Context;Landroid/content/Intent;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
.line 156
|
|
:cond_1
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getApplicationDetailsIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method static getWindowPermissionIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
.locals 3
|
|
|
|
.line 104
|
|
invoke-static {}, Lcom/ph/permissions/PermissionUtils;->isAndroid6()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 105
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-string v1, "android.settings.action.MANAGE_OVERLAY_PERMISSION"
|
|
|
|
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 106
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "package:"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 109
|
|
invoke-static {p0, v0}, Lcom/ph/permissions/PermissionUtils;->hasActivityIntent(Landroid/content/Context;Landroid/content/Intent;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
.line 110
|
|
:cond_1
|
|
invoke-static {p0}, Lcom/ph/permissions/PermissionSettingPage;->getApplicationDetailsIntent(Landroid/content/Context;)Landroid/content/Intent;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_2
|
|
return-object v0
|
|
.end method
|