mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
fix: bio auth on Android
This commit is contained in:
@@ -14,14 +14,15 @@ class BioAuth {
|
||||
|
||||
static Future<bool> get isAvail async {
|
||||
if (!isPlatformSupported) return false;
|
||||
final canCheckBiometrics = await _auth.canCheckBiometrics;
|
||||
if (!canCheckBiometrics) {
|
||||
if (!await _auth.canCheckBiometrics) {
|
||||
return false;
|
||||
}
|
||||
final biometrics = await _auth.getAvailableBiometrics();
|
||||
if (biometrics.isEmpty) return false;
|
||||
return biometrics.contains(BiometricType.fingerprint) ||
|
||||
biometrics.contains(BiometricType.face);
|
||||
/// [biometrics] on Android and Windows is returned with error
|
||||
/// Handle it specially
|
||||
if (isAndroid | isWindows) return biometrics.isNotEmpty;
|
||||
return biometrics.contains(BiometricType.face) ||
|
||||
biometrics.contains(BiometricType.fingerprint);
|
||||
}
|
||||
|
||||
static Future<AuthResult> auth([String? msg]) async {
|
||||
@@ -31,7 +32,6 @@ class BioAuth {
|
||||
localizedReason: msg ?? 'Auth required',
|
||||
options: const AuthenticationOptions(
|
||||
stickyAuth: true,
|
||||
sensitiveTransaction: true,
|
||||
biometricOnly: true,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 558;
|
||||
static const int build = 560;
|
||||
static const String engine = "3.13.2";
|
||||
static const String buildAt = "2023-09-16 20:15:37";
|
||||
static const int modifications = 7;
|
||||
static const String buildAt = "2023-09-16 22:15:32";
|
||||
static const int modifications = 6;
|
||||
static const int script = 15;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user