コード例 #1
0
        public async Task UpdateBiometricAsync()
        {
            var current = _biometric;

            if (_biometric)
            {
                _biometric = false;
            }
            else if (await _platformUtilsService.SupportsBiometricAsync())
            {
                _biometric = await _platformUtilsService.AuthenticateBiometricAsync(null,
                                                                                    _deviceActionService.DeviceType == Core.Enums.DeviceType.Android? "." : null);
            }
            if (_biometric == current)
            {
                return;
            }
            if (_biometric)
            {
                await _biometricService.SetupBiometricAsync();

                await _storageService.SaveAsync(Constants.BiometricUnlockKey, true);
            }
            else
            {
                await _storageService.RemoveAsync(Constants.BiometricUnlockKey);
            }
            _vaultTimeoutService.BiometricLocked = false;
            await _cryptoService.ToggleKeyAsync();

            BuildList();
        }
コード例 #2
0
        public async Task UpdateBiometricAsync()
        {
            var current = _biometric;

            if (_biometric)
            {
                _biometric = false;
            }
            else if (await _platformUtilsService.SupportsBiometricAsync())
            {
                _biometric = await _platformUtilsService.AuthenticateBiometricAsync(null,
                                                                                    _deviceActionService.DeviceType == Core.Enums.DeviceType.Android? "." : null);
            }
            if (_biometric == current)
            {
                return;
            }
            if (_biometric)
            {
                await _biometricService.SetupBiometricAsync();

                await _stateService.SetBiometricUnlockAsync(true);
            }
            else
            {
                await _stateService.SetBiometricUnlockAsync(null);
            }
            await _stateService.SetBiometricLockedAsync(false);

            await _cryptoService.ToggleKeyAsync();

            BuildList();
        }