From d6f46cf5c54f0e362b763812d46b559b0ddfacd6 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 15 May 2019 12:54:48 -0400 Subject: [PATCH] fingerprint phrase and help settings --- src/App/Pages/Settings/SettingsPage.xaml.cs | 8 +++++++ .../Pages/Settings/SettingsPageViewModel.cs | 23 +++++++++++++++++++ src/App/Resources/AppResources.Designer.cs | 18 +++++++++++++++ src/App/Resources/AppResources.resx | 8 +++++++ 4 files changed, 57 insertions(+) diff --git a/src/App/Pages/Settings/SettingsPage.xaml.cs b/src/App/Pages/Settings/SettingsPage.xaml.cs index 492f67cac..5e93c837d 100644 --- a/src/App/Pages/Settings/SettingsPage.xaml.cs +++ b/src/App/Pages/Settings/SettingsPage.xaml.cs @@ -44,6 +44,14 @@ namespace Bit.App.Pages { await _vm.AboutAsync(); } + else if(item.Name == AppResources.HelpAndFeedback) + { + _vm.Help(); + } + else if(item.Name == AppResources.FingerprintPhrase) + { + await _vm.FingerprintAsync(); + } } } } diff --git a/src/App/Pages/Settings/SettingsPageViewModel.cs b/src/App/Pages/Settings/SettingsPageViewModel.cs index 92540e8b7..bed70efb8 100644 --- a/src/App/Pages/Settings/SettingsPageViewModel.cs +++ b/src/App/Pages/Settings/SettingsPageViewModel.cs @@ -11,10 +11,14 @@ namespace Bit.App.Pages public class SettingsPageViewModel : BaseViewModel { private readonly IPlatformUtilsService _platformUtilsService; + private readonly ICryptoService _cryptoService; + private readonly IUserService _userService; public SettingsPageViewModel() { _platformUtilsService = ServiceContainer.Resolve("platformUtilsService"); + _cryptoService = ServiceContainer.Resolve("cryptoService"); + _userService = ServiceContainer.Resolve("userService"); PageTitle = AppResources.Settings; BuildList(); @@ -35,6 +39,24 @@ namespace Bit.App.Pages } } + public void Help() + { + _platformUtilsService.LaunchUri("https://help.bitwarden.com/"); + } + + public async Task FingerprintAsync() + { + var fingerprint = await _cryptoService.GetFingerprintAsync(await _userService.GetUserIdAsync()); + var phrase = string.Join("-", fingerprint); + var text = string.Format("{0}\n\n{1}", AppResources.YourAccountsFingerprint, phrase); + var learnMore = await _platformUtilsService.ShowDialogAsync(text, AppResources.FingerprintPhrase, + AppResources.LearnMore, AppResources.Close); + if(learnMore) + { + _platformUtilsService.LaunchUri("https://help.bitwarden.com/article/fingerprint-phrase/"); + } + } + private void BuildList() { var doUpper = Device.RuntimePlatform != Device.Android; @@ -54,6 +76,7 @@ namespace Bit.App.Pages var accountItems = new List { new SettingsPageListItem { Name = AppResources.ChangeMasterPassword }, + new SettingsPageListItem { Name = AppResources.FingerprintPhrase }, new SettingsPageListItem { Name = AppResources.LogOut } }; var otherItems = new List diff --git a/src/App/Resources/AppResources.Designer.cs b/src/App/Resources/AppResources.Designer.cs index 7060e8372..f42c9f772 100644 --- a/src/App/Resources/AppResources.Designer.cs +++ b/src/App/Resources/AppResources.Designer.cs @@ -1617,6 +1617,15 @@ namespace Bit.App.Resources { } } + /// + /// Looks up a localized string similar to Fingerprint Phrase. + /// + public static string FingerprintPhrase { + get { + return ResourceManager.GetString("FingerprintPhrase", resourceCulture); + } + } + /// /// Looks up a localized string similar to First Name. /// @@ -3813,6 +3822,15 @@ namespace Bit.App.Resources { } } + /// + /// Looks up a localized string similar to Your account's fingerprint phrase. + /// + public static string YourAccountsFingerprint { + get { + return ResourceManager.GetString("YourAccountsFingerprint", resourceCulture); + } + } + /// /// Looks up a localized string similar to To continue, hold your YubiKey NEO against the back of the device or insert your YubiKey into your device's USB port, then touch its button.. /// diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx index 3bbbb2ee6..383ddc23f 100644 --- a/src/App/Resources/AppResources.resx +++ b/src/App/Resources/AppResources.resx @@ -1467,4 +1467,12 @@ There are no folders to list. + + Fingerprint Phrase + A 'fingerprint phrase' is a unique word phrase (similar to a passphrase) that a user can use to authenticate their public key with another user, for the purposes of sharing. + + + Your account's fingerprint phrase + A 'fingerprint phrase' is a unique word phrase (similar to a passphrase) that a user can use to authenticate their public key with another user, for the purposes of sharing. + \ No newline at end of file