mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-12-03 03:00:23 +01:00
46 lines
1.6 KiB
Java
46 lines
1.6 KiB
Java
package androidx.biometric;
|
|
|
|
import android.os.Build;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.biometric.BiometricPrompt;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes.dex */
|
|
class AuthenticatorUtils {
|
|
private static final int BIOMETRIC_CLASS_MASK = 32767;
|
|
|
|
private AuthenticatorUtils() {
|
|
}
|
|
|
|
public static String convertToString(int i) {
|
|
return i != 15 ? i != 255 ? i != 32768 ? i != 32783 ? i != 33023 ? String.valueOf(i) : "BIOMETRIC_WEAK | DEVICE_CREDENTIAL" : "BIOMETRIC_STRONG | DEVICE_CREDENTIAL" : "DEVICE_CREDENTIAL" : "BIOMETRIC_WEAK" : "BIOMETRIC_STRONG";
|
|
}
|
|
|
|
public static int getConsolidatedAuthenticators(@NonNull BiometricPrompt.PromptInfo promptInfo, @Nullable BiometricPrompt.CryptoObject cryptoObject) {
|
|
if (promptInfo.getAllowedAuthenticators() != 0) {
|
|
return promptInfo.getAllowedAuthenticators();
|
|
}
|
|
int i = cryptoObject != null ? 15 : 255;
|
|
return promptInfo.isDeviceCredentialAllowed() ? 32768 | i : i;
|
|
}
|
|
|
|
public static boolean isDeviceCredentialAllowed(int i) {
|
|
return (i & 32768) != 0;
|
|
}
|
|
|
|
public static boolean isSomeBiometricAllowed(int i) {
|
|
return (i & 32767) != 0;
|
|
}
|
|
|
|
public static boolean isSupportedCombination(int i) {
|
|
if (i != 15 && i != 255) {
|
|
return i != 32768 ? i != 32783 ? i == 33023 || i == 0 : Build.VERSION.SDK_INT > 29 : Build.VERSION.SDK_INT >= 30;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public static boolean isWeakBiometricAllowed(int i) {
|
|
return (i & 255) == 255;
|
|
}
|
|
}
|