granularity level: instruction
.class public final Landroidx/core/content/PermissionChecker;
.super Ljava/lang/Object;
.source "PermissionChecker.java"
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/core/content/PermissionChecker$PermissionResult;
}
.end annotation
.field public static final PERMISSION_DENIED:I = -0x1
.field public static final PERMISSION_DENIED_APP_OP:I = -0x2
.field public static final PERMISSION_GRANTED:I
.method private constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static checkCallingOrSelfPermission(Landroid/content/Context;Ljava/lang/String;)I
.locals 3
invoke-static {}, Landroid/os/Binder;->getCallingPid()I
move-result v0
invoke-static {}, Landroid/os/Process;->myPid()I
move-result v1
if-ne v0, v1, :cond_0
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v0
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
invoke-static {}, Landroid/os/Binder;->getCallingPid()I
move-result v1
invoke-static {}, Landroid/os/Binder;->getCallingUid()I
move-result v2
invoke-static {p0, p1, v1, v2, v0}, Landroidx/core/content/PermissionChecker;->checkPermission(Landroid/content/Context;Ljava/lang/String;IILjava/lang/String;)I
move-result p0
return p0
.end method
.method public static checkCallingPermission(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)I
.locals 2
invoke-static {}, Landroid/os/Binder;->getCallingPid()I
move-result v0
invoke-static {}, Landroid/os/Process;->myPid()I
move-result v1
if-ne v0, v1, :cond_0
const/4 p0, -0x1
return p0
:cond_0
invoke-static {}, Landroid/os/Binder;->getCallingPid()I
move-result v0
invoke-static {}, Landroid/os/Binder;->getCallingUid()I
move-result v1
invoke-static {p0, p1, v0, v1, p2}, Landroidx/core/content/PermissionChecker;->checkPermission(Landroid/content/Context;Ljava/lang/String;IILjava/lang/String;)I
move-result p0
return p0
.end method
.method public static checkPermission(Landroid/content/Context;Ljava/lang/String;IILjava/lang/String;)I
.locals 1
invoke-virtual {p0, p1, p2, p3}, Landroid/content/Context;->checkPermission(Ljava/lang/String;II)I
move-result p2
const/4 v0, -0x1
if-ne p2, v0, :cond_0
return v0
:cond_0
invoke-static {p1}, Landroidx/core/app/AppOpsManagerCompat;->permissionToOp(Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
const/4 p2, 0x0
if-nez p1, :cond_1
return p2
:cond_1
if-nez p4, :cond_4
invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object p4
invoke-virtual {p4, p3}, Landroid/content/pm/PackageManager;->getPackagesForUid(I)[Ljava/lang/String;
move-result-object p3
if-eqz p3, :cond_3
array-length p4, p3
if-gtz p4, :cond_2
goto :goto_0
:cond_2
aget-object p4, p3, p2
goto :goto_1
:goto_0
:cond_3
return v0
:goto_1
:cond_4
invoke-static {p0, p1, p4}, Landroidx/core/app/AppOpsManagerCompat;->noteProxyOpNoThrow(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)I
move-result p0
if-eqz p0, :cond_5
const/4 p0, -0x2
return p0
:cond_5
return p2
.end method
.method public static checkSelfPermission(Landroid/content/Context;Ljava/lang/String;)I
.locals 3
invoke-static {}, Landroid/os/Process;->myPid()I
move-result v0
invoke-static {}, Landroid/os/Process;->myUid()I
move-result v1
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v2
invoke-static {p0, p1, v0, v1, v2}, Landroidx/core/content/PermissionChecker;->checkPermission(Landroid/content/Context;Ljava/lang/String;IILjava/lang/String;)I
move-result p0
return p0
.end method