diff --git a/src/App/Resources/AppResources.Designer.cs b/src/App/Resources/AppResources.Designer.cs index 42b0e164a..809505e93 100644 --- a/src/App/Resources/AppResources.Designer.cs +++ b/src/App/Resources/AppResources.Designer.cs @@ -312,6 +312,15 @@ namespace Bit.App.Resources { } } + /// + /// Looks up a localized string similar to AutoFill Activated!. + /// + public static string AutofillActivated { + get { + return ResourceManager.GetString("AutofillActivated", resourceCulture); + } + } + /// /// Looks up a localized string similar to Always Scan. /// @@ -402,6 +411,24 @@ namespace Bit.App.Resources { } } + /// + /// Looks up a localized string similar to Your logins are now easily accessable right from your keyboard while logging into apps and websites.. + /// + public static string AutofillSetup { + get { + return ResourceManager.GetString("AutofillSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to We recommend disabling any other AutoFill apps under Settings if you do not plan to use them.. + /// + public static string AutofillSetup2 { + get { + return ResourceManager.GetString("AutofillSetup2", resourceCulture); + } + } + /// /// Looks up a localized string similar to Auto-fill with Bitwarden. /// @@ -2175,6 +2202,15 @@ namespace Bit.App.Resources { } } + /// + /// Looks up a localized string similar to You must log into the main Bitwarden app before you can use AutoFill.. + /// + public static string MustLogInMainAppAutofill { + get { + return ResourceManager.GetString("MustLogInMainAppAutofill", resourceCulture); + } + } + /// /// Looks up a localized string similar to My Vault. /// @@ -2302,7 +2338,7 @@ namespace Bit.App.Resources { } /// - /// Looks up a localized string similar to There are no items in your vault for this website. Tap to add one.. + /// Looks up a localized string similar to There are no items in your vault for this website/app. Tap to add one.. /// public static string NoItemsTap { get { diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx index 916264ae4..a449aca4e 100644 --- a/src/App/Resources/AppResources.resx +++ b/src/App/Resources/AppResources.resx @@ -606,7 +606,7 @@ There are no items in your vault. - There are no items in your vault for this website. Tap to add one. + There are no items in your vault for this website/app. Tap to add one. This login does not have a username or password configured. @@ -1313,4 +1313,16 @@ Updated ex. Date this item was updated + + AutoFill Activated! + + + You must log into the main Bitwarden app before you can use AutoFill. + + + Your logins are now easily accessable right from your keyboard while logging into apps and websites. + + + We recommend disabling any other AutoFill apps under Settings if you do not plan to use them. + \ No newline at end of file diff --git a/src/iOS.Autofill/CredentialProviderViewController.cs b/src/iOS.Autofill/CredentialProviderViewController.cs index ab09a781c..bfa7cf93a 100644 --- a/src/iOS.Autofill/CredentialProviderViewController.cs +++ b/src/iOS.Autofill/CredentialProviderViewController.cs @@ -55,15 +55,8 @@ namespace Bit.iOS.Autofill { _context.ServiceIdentifiers = serviceIdentifiers; _context.UrlString = serviceIdentifiers[0].Identifier; - - var authService = Resolver.Resolve(); - if(!authService.IsAuthenticated) + if(!CheckAuthed()) { - var alert = Dialogs.CreateAlert(null, AppResources.MustLogInMainApp, AppResources.Ok, (a) => - { - CompleteRequest(); - }); - PresentViewController(alert, true, null); return; } @@ -110,37 +103,21 @@ namespace Bit.iOS.Autofill public override void PrepareInterfaceToProvideCredential(ASPasswordCredentialIdentity credentialIdentity) { - var authService = Resolver.Resolve(); - if(!authService.IsAuthenticated) + if(!CheckAuthed()) { - var alert = Dialogs.CreateAlert(null, AppResources.MustLogInMainApp, AppResources.Ok, (a) => - { - CompleteRequest(); - }); - PresentViewController(alert, true, null); return; } - _context.CredentialIdentity = credentialIdentity; CheckLock(() => ProvideCredential()); } public override void PrepareInterfaceForExtensionConfiguration() { - System.Diagnostics.Debug.WriteLine("AUTOFILL BITWARDEN: PrepareInterfaceForExtensionConfiguration"); _context.Configuring = true; - - var authService = Resolver.Resolve(); - if(!authService.IsAuthenticated) + if(!CheckAuthed()) { - var alert = Dialogs.CreateAlert(null, AppResources.MustLogInMainApp, AppResources.Ok, (a) => - { - CompleteRequest(); - }); - PresentViewController(alert, true, null); return; } - CheckLock(() => PerformSegue("setupSegue", this)); } @@ -274,6 +251,21 @@ namespace Bit.iOS.Autofill } } + private bool CheckAuthed() + { + var authService = Resolver.Resolve(); + if(!authService.IsAuthenticated) + { + var alert = Dialogs.CreateAlert(null, AppResources.MustLogInMainAppAutofill, AppResources.Ok, (a) => + { + CompleteRequest(); + }); + PresentViewController(alert, true, null); + return false; + } + return true; + } + private void SetIoc() { var container = new Container(); diff --git a/src/iOS.Autofill/LoginListViewController.cs b/src/iOS.Autofill/LoginListViewController.cs index 2690ea1a0..33d3db4dc 100644 --- a/src/iOS.Autofill/LoginListViewController.cs +++ b/src/iOS.Autofill/LoginListViewController.cs @@ -1,22 +1,11 @@ using System; -using System.Collections.Generic; -using System.Diagnostics; using System.Linq; -using Bit.App.Abstractions; using Bit.iOS.Autofill.Models; using Foundation; using UIKit; -using XLabs.Ioc; -using Plugin.Settings.Abstractions; using Bit.iOS.Core.Utilities; -using System.Threading.Tasks; -using Bit.iOS.Core; -using MobileCoreServices; using Bit.iOS.Core.Controllers; using Bit.App.Resources; -using Bit.App.Models; -using Bit.App.Utilities; -using Bit.iOS.Core.Models; using Bit.iOS.Core.Views; namespace Bit.iOS.Autofill @@ -121,8 +110,7 @@ namespace Bit.iOS.Autofill _controller.CPViewController.CompleteRequest(item.Username, item.Password, totp); } - else if(!string.IsNullOrWhiteSpace(item.Username) || !string.IsNullOrWhiteSpace(item.Password) || - !string.IsNullOrWhiteSpace(item.Totp.Value)) + else if(!string.IsNullOrWhiteSpace(item.Username) || !string.IsNullOrWhiteSpace(item.Totp.Value)) { var sheet = Dialogs.CreateActionSheet(item.Name, _controller); if(!string.IsNullOrWhiteSpace(item.Username)) @@ -139,20 +127,6 @@ namespace Bit.iOS.Autofill })); } - if(!string.IsNullOrWhiteSpace(item.Password)) - { - sheet.AddAction(UIAlertAction.Create(AppResources.CopyPassword, UIAlertActionStyle.Default, a => - { - UIPasteboard clipboard = UIPasteboard.General; - clipboard.String = item.Password; - var alert = Dialogs.CreateMessageAlert(AppResources.CopiedPassword); - _controller.PresentViewController(alert, true, () => - { - _controller.DismissViewController(true, null); - }); - })); - } - if(!string.IsNullOrWhiteSpace(item.Totp.Value)) { sheet.AddAction(UIAlertAction.Create(AppResources.CopyTotp, UIAlertActionStyle.Default, a => diff --git a/src/iOS.Autofill/MainInterface.storyboard b/src/iOS.Autofill/MainInterface.storyboard index e0d0b6a73..e0c5819a5 100644 --- a/src/iOS.Autofill/MainInterface.storyboard +++ b/src/iOS.Autofill/MainInterface.storyboard @@ -548,7 +548,7 @@ - + diff --git a/src/iOS.Autofill/Resources/check.png b/src/iOS.Autofill/Resources/check.png new file mode 100644 index 000000000..64c9cc5a3 Binary files /dev/null and b/src/iOS.Autofill/Resources/check.png differ diff --git a/src/iOS.Autofill/Resources/check@2x.png b/src/iOS.Autofill/Resources/check@2x.png new file mode 100644 index 000000000..40808a3b2 Binary files /dev/null and b/src/iOS.Autofill/Resources/check@2x.png differ diff --git a/src/iOS.Autofill/Resources/check@3x.png b/src/iOS.Autofill/Resources/check@3x.png new file mode 100644 index 000000000..759ca1e74 Binary files /dev/null and b/src/iOS.Autofill/Resources/check@3x.png differ diff --git a/src/iOS.Autofill/SetupViewController.cs b/src/iOS.Autofill/SetupViewController.cs index fbd6604bb..789de5800 100644 --- a/src/iOS.Autofill/SetupViewController.cs +++ b/src/iOS.Autofill/SetupViewController.cs @@ -26,13 +26,13 @@ namespace Bit.iOS.Autofill { View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f); var descriptor = UIFontDescriptor.PreferredBody; - DescriptionLabel.Text = $@"{AppResources.ExtensionSetup} + DescriptionLabel.Text = $@"{AppResources.AutofillSetup} -{AppResources.ExtensionSetup2}"; +{AppResources.AutofillSetup2}"; DescriptionLabel.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize); DescriptionLabel.TextColor = new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f); - ActivatedLabel.Text = AppResources.ExtensionActivated; + ActivatedLabel.Text = AppResources.AutofillActivated; ActivatedLabel.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize * 1.3f); BackButton.Title = AppResources.Back; diff --git a/src/iOS.Autofill/iOS.Autofill.csproj b/src/iOS.Autofill/iOS.Autofill.csproj index d1974f1d4..d53f88de8 100644 --- a/src/iOS.Autofill/iOS.Autofill.csproj +++ b/src/iOS.Autofill/iOS.Autofill.csproj @@ -286,5 +286,14 @@ 2.0.5782 + + + + + + + + + \ No newline at end of file