- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
63 lines
1.8 KiB
Java
63 lines
1.8 KiB
Java
package androidx.core.os;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.os.Process;
|
|
import android.os.UserHandle;
|
|
import androidx.annotation.RequiresApi;
|
|
import java.lang.reflect.Method;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class ProcessCompat {
|
|
private ProcessCompat() {
|
|
}
|
|
|
|
public static boolean isApplicationUid(int i) {
|
|
return Api24Impl.isApplicationUid(i);
|
|
}
|
|
|
|
@RequiresApi(24)
|
|
public static class Api24Impl {
|
|
private Api24Impl() {
|
|
}
|
|
|
|
public static boolean isApplicationUid(int i) {
|
|
return Process.isApplicationUid(i);
|
|
}
|
|
}
|
|
|
|
public static class Api19Impl {
|
|
private static Method sMethodUserHandleIsAppMethod;
|
|
private static boolean sResolved;
|
|
private static final Object sResolvedLock = new Object();
|
|
|
|
private Api19Impl() {
|
|
}
|
|
|
|
@SuppressLint({"DiscouragedPrivateApi"})
|
|
public static boolean isApplicationUid(int i) {
|
|
try {
|
|
synchronized (sResolvedLock) {
|
|
try {
|
|
if (!sResolved) {
|
|
sResolved = true;
|
|
sMethodUserHandleIsAppMethod = UserHandle.class.getDeclaredMethod("isApp", Integer.TYPE);
|
|
}
|
|
} finally {
|
|
}
|
|
}
|
|
Method method = sMethodUserHandleIsAppMethod;
|
|
if (method != null) {
|
|
Boolean bool = (Boolean) method.invoke(null, Integer.valueOf(i));
|
|
if (bool == null) {
|
|
throw new NullPointerException();
|
|
}
|
|
return bool.booleanValue();
|
|
}
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
}
|