package o; import android.content.Context; import android.os.Binder; import android.os.Process; /* renamed from: o.zKa, reason: case insensitive filesystem */ /* loaded from: classes.dex */ public final class C17730zKa { public static int b(Context context, String str, int i, int i2, String str2) { int a; if (context.checkPermission(str, i, i2) == -1) { return -1; } String e = hqT.e(str); if (e == null) { return 0; } if (str2 == null) { String[] packagesForUid = context.getPackageManager().getPackagesForUid(i2); if (packagesForUid == null || packagesForUid.length <= 0) { return -1; } str2 = packagesForUid[0]; } int myUid = Process.myUid(); String packageName = context.getPackageName(); if (myUid == i2 && ZEY.b(packageName, str2)) { a = hqT.d(context, i2, e, str2); } else { a = hqT.a(context, e, str2); } return a == 0 ? 0 : -2; } public static int b(Context context, String str) { return b(context, str, Process.myPid(), Process.myUid(), context.getPackageName()); } public static int d(Context context, String str) { return b(context, str, Binder.getCallingPid(), Binder.getCallingUid(), Binder.getCallingPid() == Process.myPid() ? context.getPackageName() : null); } }