コード例 #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 UpdateFingerprintAsync()
        {
            var current = _fingerprint;

            if (_fingerprint)
            {
                _fingerprint = false;
            }
            else if (await _platformUtilsService.SupportsBiometricAsync())
            {
                _fingerprint = await _platformUtilsService.AuthenticateBiometricAsync(null,
                                                                                      _deviceActionService.DeviceType == Core.Enums.DeviceType.Android? "." : null);
            }
            if (_fingerprint == current)
            {
                return;
            }
            if (_fingerprint)
            {
                await _storageService.SaveAsync(Constants.FingerprintUnlockKey, true);
            }
            else
            {
                await _storageService.RemoveAsync(Constants.FingerprintUnlockKey);
            }
            _lockService.FingerprintLocked = false;
            await _cryptoService.ToggleKeyAsync();

            BuildList();
        }
コード例 #3
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();
        }