Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Add Android specific (strong) biometrics unavailable error message (#2334)

Leendert de Borst80a9d18d238c
diff --git a/apps/mobile-app/app/(tabs)/settings/vault-unlock.tsx b/apps/mobile-app/app/(tabs)/settings/vault-unlock.tsx
index 04272b6aa..c69b8aeb4 100644
--- a/apps/mobile-app/app/(tabs)/settings/vault-unlock.tsx
+++ b/apps/mobile-app/app/(tabs)/settings/vault-unlock.tsx
@@ -266,7 +266,7 @@ export default function VaultUnlockSettingsScreen() : React.ReactNode {
fontSize: 16,
},
warningText: {
- color: colors.errorBorder,
+ color: colors.errorText,
fontSize: 13,
marginTop: 4,
},
@@ -301,8 +301,10 @@ export default function VaultUnlockSettingsScreen() : React.ReactNode {
})}
</ThemedText>
{!hasBiometrics && (
- <ThemedText style={[styles.helpText, { color: colors.errorBorder }]}>
- {t('settings.vaultUnlockSettings.biometricUnavailableHelp', { biometric: biometricDisplayName })}
+ <ThemedText style={[styles.helpText, { color: colors.errorText }]}>
+ {Platform.OS === 'android'
+ ? t('settings.vaultUnlockSettings.biometricUnavailableHelpAndroid')
+ : t('settings.vaultUnlockSettings.biometricUnavailableHelp', { biometric: biometricDisplayName })}
</ThemedText>
)}
</TouchableOpacity>
diff --git a/apps/mobile-app/i18n/locales/en.json b/apps/mobile-app/i18n/locales/en.json
index c532233b8..2a29e9e7e 100644
--- a/apps/mobile-app/i18n/locales/en.json
+++ b/apps/mobile-app/i18n/locales/en.json
@@ -226,6 +226,7 @@
"biometricDisabledMessage": "{{biometric}} is disabled for AliasVault. In order to use it, please enable it in your device settings first.",
"biometricHelp": "Use biometrics to unlock your vault, which is secured by the {{keystore}}.",
"biometricUnavailableHelp": "{{biometric}} is not available. Tap to open settings and/or go to your device settings to enable and configure it.",
+ "biometricUnavailableHelpAndroid": "Strong biometrics are not available. Android requires a strong (Class 3) biometric to protect your vault key: a fingerprint, or face unlock on devices where it is secure enough. You can use a PIN code instead.",
"featureRequiresPasscode": "This feature requires a passcode to be enabled on your device.",
"pin": "PIN Code",
"pinDescription": "Use a custom PIN code to unlock your vault more quickly.",
diff --git a/apps/mobile-app/utils/AppUnlockUtility.ts b/apps/mobile-app/utils/AppUnlockUtility.ts
index 6f5083adb..4d90994c1 100644
--- a/apps/mobile-app/utils/AppUnlockUtility.ts
+++ b/apps/mobile-app/utils/AppUnlockUtility.ts
@@ -20,8 +20,8 @@ export class AppUnlockUtility {
let methods = await NativeVaultManager.getAuthMethods() as AuthMethod[];
// Check if Face ID is actually available despite being enabled
if (methods.includes('faceid')) {
- const isEnrolled = await LocalAuthentication.isEnrolledAsync();
- if (!isEnrolled) {
+ const isAvailable = await this.isBiometricsAvailableOnDevice();
+ if (!isAvailable) {
// Remove Face ID from the list of enabled auth methods
methods = methods.filter(method => method !== 'faceid');
}
@@ -92,12 +92,7 @@ export class AppUnlockUtility {
*/
static async isBiometricsAvailableOnDevice(): Promise<boolean> {
try {
- const hasHardware = await LocalAuthentication.hasHardwareAsync();
- if (!hasHardware) {
- return false;
- }
-
- return await LocalAuthentication.isEnrolledAsync();
+ return await NativeVaultManager.isBiometricsAvailableOnDevice();
} catch (error) {
console.error('Error checking biometric device availability:', error);
return false;