Run dotnet format (#1738)

This commit is contained in:
Oscar Hinton 2022-04-26 17:21:17 +02:00 committed by GitHub
parent e0efcfbe45
commit 04539af2a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
222 changed files with 723 additions and 706 deletions

View File

@ -1,6 +1,6 @@
using Bit.Core.Enums; using System.Threading.Tasks;
using Bit.Core.Enums;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using System.Threading.Tasks;
namespace Bit.App.Abstractions namespace Bit.App.Abstractions
{ {

View File

@ -7,7 +7,7 @@ namespace Bit.App.Abstractions
string[] ProtectedFields { get; } string[] ProtectedFields { get; }
Task<bool> ShowPasswordPromptAsync(); Task<bool> ShowPasswordPromptAsync();
Task<(string password, bool valid)> ShowPasswordPromptAndGetItAsync(); Task<(string password, bool valid)> ShowPasswordPromptAndGetItAsync();
Task<bool> Enabled(); Task<bool> Enabled();

View File

@ -1,5 +1,5 @@
using Newtonsoft.Json.Linq; using System.Threading.Tasks;
using System.Threading.Tasks; using Newtonsoft.Json.Linq;
namespace Bit.App.Abstractions namespace Bit.App.Abstractions
{ {

View File

@ -1,15 +1,15 @@
using Bit.App.Abstractions; using System;
using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Models; using Bit.App.Models;
using Bit.App.Pages; using Bit.App.Pages;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.App.Services; using Bit.App.Services;
using Bit.App.Utilities; using Bit.App.Utilities;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Enums;
using Bit.Core.Models.Data; using Bit.Core.Models.Data;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System;
using System.Threading.Tasks;
using Bit.Core.Enums;
using Xamarin.Forms; using Xamarin.Forms;
using Xamarin.Forms.Xaml; using Xamarin.Forms.Xaml;
@ -318,7 +318,7 @@ namespace Bit.App
Options.HideAccountSwitcher = await _stateService.GetActiveUserIdAsync() == null; Options.HideAccountSwitcher = await _stateService.GetActiveUserIdAsync() == null;
Current.MainPage = new NavigationPage(new LoginPage(email, Options)); Current.MainPage = new NavigationPage(new LoginPage(email, Options));
} }
else if (await _vaultTimeoutService.IsLockedAsync() || else if (await _vaultTimeoutService.IsLockedAsync() ||
await _vaultTimeoutService.ShouldLockAsync()) await _vaultTimeoutService.ShouldLockAsync())
{ {
Current.MainPage = new NavigationPage(new LockPage(Options)); Current.MainPage = new NavigationPage(new LockPage(Options));

View File

@ -99,7 +99,7 @@ namespace Bit.App.Controls
Opacity = 0; Opacity = 0;
IsVisible = true; IsVisible = true;
this.FadeTo(1, 100); this.FadeTo(1, 100);
if (Device.RuntimePlatform == Device.Android && MainFab != null) if (Device.RuntimePlatform == Device.Android && MainFab != null)
{ {
// start fab fade-out // start fab fade-out

View File

@ -22,11 +22,11 @@ namespace Bit.App.Controls
{ {
_stateService = stateService; _stateService = stateService;
_messagingService = messagingService; _messagingService = messagingService;
SelectAccountCommand = new AsyncCommand<AccountViewCellViewModel>(SelectAccountAsync, SelectAccountCommand = new AsyncCommand<AccountViewCellViewModel>(SelectAccountAsync,
onException: ex => logger.Exception(ex), onException: ex => logger.Exception(ex),
allowsMultipleExecutions: false); allowsMultipleExecutions: false);
LongPressAccountCommand = new AsyncCommand<Tuple<ContentPage, AccountViewCellViewModel>>(LongPressAccountAsync, LongPressAccountCommand = new AsyncCommand<Tuple<ContentPage, AccountViewCellViewModel>>(LongPressAccountAsync,
onException: ex => logger.Exception(ex), onException: ex => logger.Exception(ex),
allowsMultipleExecutions: false); allowsMultipleExecutions: false);

View File

@ -1,5 +1,5 @@
using System.Windows.Input;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using System.Windows.Input;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Controls namespace Bit.App.Controls

View File

@ -112,13 +112,13 @@ namespace Bit.App.Controls
private string GetFirstLetters(string data, int charCount) private string GetFirstLetters(string data, int charCount)
{ {
var parts = data.Split(); var parts = data.Split();
if (parts.Length > 1 && charCount <= 2) if (parts.Length > 1 && charCount <= 2)
{ {
var text = ""; var text = "";
for (int i = 0; i < charCount; i++) for (int i = 0; i < charCount; i++)
{ {
text += parts[i].Substring(0,1); text += parts[i].Substring(0, 1);
} }
return text; return text;
} }

View File

@ -6,7 +6,7 @@ namespace Bit.App.Controls
{ {
public static readonly BindableProperty StepperBackgroundColorProperty = BindableProperty.Create( public static readonly BindableProperty StepperBackgroundColorProperty = BindableProperty.Create(
nameof(StepperBackgroundColor), typeof(Color), typeof(ExtendedStepper), Color.Default); nameof(StepperBackgroundColor), typeof(Color), typeof(ExtendedStepper), Color.Default);
public static readonly BindableProperty StepperForegroundColorProperty = BindableProperty.Create( public static readonly BindableProperty StepperForegroundColorProperty = BindableProperty.Create(
nameof(StepperForegroundColor), typeof(Color), typeof(ExtendedStepper), Color.Default); nameof(StepperForegroundColor), typeof(Color), typeof(ExtendedStepper), Color.Default);
@ -15,7 +15,7 @@ namespace Bit.App.Controls
get => (Color)GetValue(StepperBackgroundColorProperty); get => (Color)GetValue(StepperBackgroundColorProperty);
set => SetValue(StepperBackgroundColorProperty, value); set => SetValue(StepperBackgroundColorProperty, value);
} }
public Color StepperForegroundColor public Color StepperForegroundColor
{ {
get => (Color)GetValue(StepperForegroundColorProperty); get => (Color)GetValue(StepperForegroundColorProperty);

View File

@ -1,4 +1,4 @@
using System; using System;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
@ -13,7 +13,7 @@ namespace Bit.App.Controls
public static readonly BindableProperty ButtonCommandProperty = BindableProperty.Create( public static readonly BindableProperty ButtonCommandProperty = BindableProperty.Create(
nameof(ButtonCommand), typeof(Command<SendView>), typeof(SendViewCell)); nameof(ButtonCommand), typeof(Command<SendView>), typeof(SendViewCell));
public static readonly BindableProperty ShowOptionsProperty = BindableProperty.Create( public static readonly BindableProperty ShowOptionsProperty = BindableProperty.Create(
nameof(ShowOptions), typeof(bool), typeof(SendViewCell), true, BindingMode.OneWay); nameof(ShowOptions), typeof(bool), typeof(SendViewCell), true, BindingMode.OneWay);

View File

@ -4,8 +4,8 @@ namespace Bit.App.Effects
{ {
public class FabShadowEffect : RoutingEffect public class FabShadowEffect : RoutingEffect
{ {
public FabShadowEffect() public FabShadowEffect()
: base("Bitwarden.FabShadowEffect") : base("Bitwarden.FabShadowEffect")
{ } { }
} }
} }

View File

@ -1,12 +1,12 @@
using Bit.App.Resources; using System.Collections.Generic;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using System.Collections.Generic;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.App.Resources;
using Bit.Core.Abstractions;
using Bit.Core.Models.Domain; using Bit.Core.Models.Domain;
using Bit.Core.Utilities;
using Xamarin.Essentials; using Xamarin.Essentials;
namespace Bit.App.Pages namespace Bit.App.Pages
@ -66,7 +66,7 @@ namespace Bit.App.Pages
get => _policy; get => _policy;
set => SetProperty(ref _policy, value); set => SetProperty(ref _policy, value);
} }
public string ShowPasswordIcon => ShowPassword ? "" : ""; public string ShowPasswordIcon => ShowPassword ? "" : "";
public string MasterPassword { get; set; } public string MasterPassword { get; set; }
public string ConfirmMasterPassword { get; set; } public string ConfirmMasterPassword { get; set; }
@ -84,7 +84,7 @@ namespace Bit.App.Pages
await CheckPasswordPolicy(); await CheckPasswordPolicy();
} }
} }
private async Task CheckPasswordPolicy() private async Task CheckPasswordPolicy()
{ {
Policy = await _policyService.GetMasterPasswordPolicyOptions(); Policy = await _policyService.GetMasterPasswordPolicyOptions();
@ -166,7 +166,7 @@ namespace Bit.App.Pages
AppResources.AnErrorHasOccurred, AppResources.Ok); AppResources.AnErrorHasOccurred, AppResources.Ok);
return false; return false;
} }
return true; return true;
} }

View File

@ -1,8 +1,8 @@
using Bit.Core.Abstractions; using System;
using Bit.Core.Utilities;
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages

View File

@ -1,8 +1,8 @@
using Bit.App.Resources; using System;
using System.Threading.Tasks;
using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System;
using System.Threading.Tasks;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages

View File

@ -1,9 +1,9 @@
using Bit.App.Abstractions; using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Threading.Tasks;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages

View File

@ -87,7 +87,7 @@ namespace Bit.App.Pages
{ {
_logo.Source = !ThemeManager.UsingLightTheme ? "logo_white.png" : "logo.png"; _logo.Source = !ThemeManager.UsingLightTheme ? "logo_white.png" : "logo.png";
} }
private void Cancel_Clicked(object sender, EventArgs e) private void Cancel_Clicked(object sender, EventArgs e)
{ {
if (DoOnce()) if (DoOnce())
@ -117,7 +117,7 @@ namespace Bit.App.Pages
_vm.StartRegisterAction(); _vm.StartRegisterAction();
} }
} }
private async Task StartRegisterAsync() private async Task StartRegisterAsync()
{ {
var page = new RegisterPage(this); var page = new RegisterPage(this);
@ -145,7 +145,7 @@ namespace Bit.App.Pages
_vm.StartEnvironmentAction(); _vm.StartEnvironmentAction();
} }
} }
private async Task StartEnvironmentAsync() private async Task StartEnvironmentAsync()
{ {
await _accountListOverlay.HideAsync(); await _accountListOverlay.HideAsync();

View File

@ -272,7 +272,7 @@ namespace Bit.App.Pages
var key = await _cryptoService.MakeKeyAsync(MasterPassword, _email, kdf, kdfIterations); var key = await _cryptoService.MakeKeyAsync(MasterPassword, _email, kdf, kdfIterations);
var storedKeyHash = await _cryptoService.GetKeyHashAsync(); var storedKeyHash = await _cryptoService.GetKeyHashAsync();
var passwordValid = false; var passwordValid = false;
if (storedKeyHash != null) if (storedKeyHash != null)
{ {
passwordValid = await _cryptoService.CompareAndUpdateKeyHashAsync(MasterPassword, key); passwordValid = await _cryptoService.CompareAndUpdateKeyHashAsync(MasterPassword, key);

View File

@ -177,7 +177,7 @@ namespace Bit.App.Pages
var previousPage = await AppHelpers.ClearPreviousPage(); var previousPage = await AppHelpers.ClearPreviousPage();
Application.Current.MainPage = new TabsPage(_appOptions, previousPage); Application.Current.MainPage = new TabsPage(_appOptions, previousPage);
} }
private async Task UpdateTempPasswordAsync() private async Task UpdateTempPasswordAsync()
{ {
var page = new UpdateTempPasswordPage(); var page = new UpdateTempPasswordPage();

View File

@ -67,7 +67,7 @@ namespace Bit.App.Pages
get => _showCancelButton; get => _showCancelButton;
set => SetProperty(ref _showCancelButton, value); set => SetProperty(ref _showCancelButton, value);
} }
public string Email public string Email
{ {
get => _email; get => _email;

View File

@ -1,9 +1,9 @@
using Bit.App.Models; using System;
using System.Threading.Tasks;
using Bit.App.Models;
using Bit.App.Utilities;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System;
using System.Threading.Tasks;
using Bit.App.Utilities;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages
@ -99,7 +99,7 @@ namespace Bit.App.Pages
var page = new SetPasswordPage(_appOptions, _vm.OrgIdentifier); var page = new SetPasswordPage(_appOptions, _vm.OrgIdentifier);
await Navigation.PushModalAsync(new NavigationPage(page)); await Navigation.PushModalAsync(new NavigationPage(page));
} }
private async Task UpdateTempPasswordAsync() private async Task UpdateTempPasswordAsync()
{ {
var page = new UpdateTempPasswordPage(); var page = new UpdateTempPasswordPage();

View File

@ -1,13 +1,13 @@
using Bit.App.Abstractions; using System;
using Bit.App.Resources;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Resources;
using Bit.App.Utilities; using Bit.App.Utilities;
using Bit.Core.Abstractions;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Models.Domain; using Bit.Core.Models.Domain;
using Bit.Core.Utilities;
using Xamarin.Essentials; using Xamarin.Essentials;
using Xamarin.Forms; using Xamarin.Forms;
@ -170,7 +170,7 @@ namespace Bit.App.Pages
else if (response.ResetMasterPassword) else if (response.ResetMasterPassword)
{ {
StartSetPasswordAction?.Invoke(); StartSetPasswordAction?.Invoke();
} }
else if (response.ForcePasswordReset) else if (response.ForcePasswordReset)
{ {
UpdateTempPasswordAction?.Invoke(); UpdateTempPasswordAction?.Invoke();

View File

@ -55,7 +55,7 @@ namespace Bit.App.Pages
await _vm.SubmitAsync(); await _vm.SubmitAsync();
} }
} }
private async Task RegistrationSuccessAsync(HomePage homePage) private async Task RegistrationSuccessAsync(HomePage homePage)
{ {
if (homePage != null) if (homePage != null)

View File

@ -1,14 +1,14 @@
using Bit.App.Abstractions; using System;
using System.Threading.Tasks;
using System.Windows.Input;
using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Models.Request; using Bit.Core.Models.Request;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System;
using System.Threading.Tasks;
using System.Windows.Input;
using Bit.Core;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages
@ -39,7 +39,7 @@ namespace Bit.App.Pages
SubmitCommand = new Command(async () => await SubmitAsync()); SubmitCommand = new Command(async () => await SubmitAsync());
ShowTerms = !_platformUtilsService.IsSelfHost(); ShowTerms = !_platformUtilsService.IsSelfHost();
} }
public ICommand PoliciesClickCommand => new Command<string>((url) => public ICommand PoliciesClickCommand => new Command<string>((url) =>
{ {
_platformUtilsService.LaunchUri(url); _platformUtilsService.LaunchUri(url);
@ -54,20 +54,20 @@ namespace Bit.App.Pages
nameof(ShowPasswordIcon) nameof(ShowPasswordIcon)
}); });
} }
public bool AcceptPolicies public bool AcceptPolicies
{ {
get => _acceptPolicies; get => _acceptPolicies;
set => SetProperty(ref _acceptPolicies, value); set => SetProperty(ref _acceptPolicies, value);
} }
public Thickness SwitchMargin public Thickness SwitchMargin
{ {
get => Device.RuntimePlatform == Device.Android get => Device.RuntimePlatform == Device.Android
? new Thickness(0, 0, 0, 0) ? new Thickness(0, 0, 0, 0)
: new Thickness(0, 0, 10, 0); : new Thickness(0, 0, 10, 0);
} }
public bool ShowTerms { get; set; } public bool ShowTerms { get; set; }
public Command SubmitCommand { get; } public Command SubmitCommand { get; }
public Command TogglePasswordCommand { get; } public Command TogglePasswordCommand { get; }
@ -136,7 +136,7 @@ namespace Bit.App.Pages
} }
// TODO: Password strength check? // TODO: Password strength check?
if (showLoading) if (showLoading)
{ {
await _deviceActionService.ShowLoadingAsync(AppResources.CreatingAccount); await _deviceActionService.ShowLoadingAsync(AppResources.CreatingAccount);

View File

@ -1,17 +1,17 @@
using Bit.App.Abstractions; using System;
using Bit.App.Resources;
using Bit.Core.Abstractions;
using Bit.Core.Enums;
using Bit.Core.Exceptions;
using Bit.Core.Models.Request;
using Bit.Core.Utilities;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Resources;
using Bit.Core; using Bit.Core;
using Bit.Core.Abstractions;
using Bit.Core.Enums;
using Bit.Core.Exceptions;
using Bit.Core.Models.Domain; using Bit.Core.Models.Domain;
using Bit.Core.Models.Request;
using Bit.Core.Utilities;
using Xamarin.Essentials; using Xamarin.Essentials;
using Xamarin.Forms; using Xamarin.Forms;
@ -63,7 +63,7 @@ namespace Bit.App.Pages
get => _isPolicyInEffect; get => _isPolicyInEffect;
set => SetProperty(ref _isPolicyInEffect, value); set => SetProperty(ref _isPolicyInEffect, value);
} }
public bool ResetPasswordAutoEnroll public bool ResetPasswordAutoEnroll
{ {
get => _resetPasswordAutoEnroll; get => _resetPasswordAutoEnroll;
@ -220,7 +220,7 @@ namespace Bit.App.Pages
// Enroll user // Enroll user
await _apiService.PutOrganizationUserResetPasswordEnrollmentAsync(OrgId, userId, resetRequest); await _apiService.PutOrganizationUserResetPasswordEnrollmentAsync(OrgId, userId, resetRequest);
} }
await _deviceActionService.HideLoadingAsync(); await _deviceActionService.HideLoadingAsync();
SetPasswordSuccessAction?.Invoke(); SetPasswordSuccessAction?.Invoke();
} }

View File

@ -1,11 +1,11 @@
using Bit.App.Controls; using System;
using System.Threading.Tasks;
using Bit.App.Controls;
using Bit.App.Models; using Bit.App.Models;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.App.Utilities;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System;
using System.Threading.Tasks;
using Bit.App.Utilities;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages
@ -47,7 +47,8 @@ namespace Bit.App.Pages
if (Device.RuntimePlatform == Device.iOS) if (Device.RuntimePlatform == Device.iOS)
{ {
ToolbarItems.Add(_moreItem); ToolbarItems.Add(_moreItem);
} else }
else
{ {
ToolbarItems.Add(_useAnotherTwoStepMethod); ToolbarItems.Add(_useAnotherTwoStepMethod);
} }
@ -92,7 +93,8 @@ namespace Bit.App.Pages
if (_vm.TotpMethod) if (_vm.TotpMethod)
{ {
RequestFocus(_totpEntry); RequestFocus(_totpEntry);
} else if (_vm.YubikeyMethod) }
else if (_vm.YubikeyMethod)
{ {
RequestFocus(_yubikeyTokenEntry); RequestFocus(_yubikeyTokenEntry);
} }
@ -187,7 +189,7 @@ namespace Bit.App.Pages
var page = new SetPasswordPage(_appOptions, _orgIdentifier); var page = new SetPasswordPage(_appOptions, _orgIdentifier);
await Navigation.PushModalAsync(new NavigationPage(page)); await Navigation.PushModalAsync(new NavigationPage(page));
} }
private async Task UpdateTempPasswordAsync() private async Task UpdateTempPasswordAsync()
{ {
var page = new UpdateTempPasswordPage(); var page = new UpdateTempPasswordPage();

View File

@ -1,16 +1,16 @@
using Bit.App.Abstractions; using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.App.Utilities;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Models.Request; using Bit.Core.Models.Request;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Bit.App.Utilities;
using Newtonsoft.Json; using Newtonsoft.Json;
using Xamarin.Essentials; using Xamarin.Essentials;
using Xamarin.Forms; using Xamarin.Forms;
@ -113,7 +113,7 @@ namespace Bit.App.Pages
public Action StartSetPasswordAction { get; set; } public Action StartSetPasswordAction { get; set; }
public Action CloseAction { get; set; } public Action CloseAction { get; set; }
public Action UpdateTempPasswordAction { get; set; } public Action UpdateTempPasswordAction { get; set; }
protected override II18nService i18nService => _i18nService; protected override II18nService i18nService => _i18nService;
protected override IEnvironmentService environmentService => _environmentService; protected override IEnvironmentService environmentService => _environmentService;
protected override IDeviceActionService deviceActionService => _deviceActionService; protected override IDeviceActionService deviceActionService => _deviceActionService;
@ -293,7 +293,7 @@ namespace Bit.App.Pages
await _deviceActionService.ShowLoadingAsync(AppResources.Validating); await _deviceActionService.ShowLoadingAsync(AppResources.Validating);
} }
var result = await _authService.LogInTwoFactorAsync(SelectedProviderType.Value, Token, _captchaToken, Remember); var result = await _authService.LogInTwoFactorAsync(SelectedProviderType.Value, Token, _captchaToken, Remember);
if (result.CaptchaNeeded) if (result.CaptchaNeeded)
{ {
if (await HandleCaptchaAsync(result.CaptchaSiteKey)) if (await HandleCaptchaAsync(result.CaptchaSiteKey))
@ -304,12 +304,12 @@ namespace Bit.App.Pages
return; return;
} }
_captchaToken = null; _captchaToken = null;
var task = Task.Run(() => _syncService.FullSyncAsync(true)); var task = Task.Run(() => _syncService.FullSyncAsync(true));
await _deviceActionService.HideLoadingAsync(); await _deviceActionService.HideLoadingAsync();
_messagingService.Send("listenYubiKeyOTP", false); _messagingService.Send("listenYubiKeyOTP", false);
_broadcasterService.Unsubscribe(nameof(TwoFactorPage)); _broadcasterService.Unsubscribe(nameof(TwoFactorPage));
if (_authingWithSso && result.ResetMasterPassword) if (_authingWithSso && result.ResetMasterPassword)
{ {
StartSetPasswordAction?.Invoke(); StartSetPasswordAction?.Invoke();
@ -317,7 +317,7 @@ namespace Bit.App.Pages
else if (result.ForcePasswordReset) else if (result.ForcePasswordReset)
{ {
UpdateTempPasswordAction?.Invoke(); UpdateTempPasswordAction?.Invoke();
} }
else else
{ {
TwoFactorAuthSuccessAction?.Invoke(); TwoFactorAuthSuccessAction?.Invoke();

View File

@ -1,7 +1,7 @@
using System;
using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System;
using Bit.App.Resources;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages
@ -14,29 +14,29 @@ namespace Bit.App.Pages
private readonly string _pageName; private readonly string _pageName;
public UpdateTempPasswordPage() public UpdateTempPasswordPage()
{ {
// Service Init // Service Init
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService"); _messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
_platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService"); _platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");
// Binding // Binding
InitializeComponent(); InitializeComponent();
_pageName = string.Concat(nameof(UpdateTempPasswordPage), "_", DateTime.UtcNow.Ticks); _pageName = string.Concat(nameof(UpdateTempPasswordPage), "_", DateTime.UtcNow.Ticks);
_vm = BindingContext as UpdateTempPasswordPageViewModel; _vm = BindingContext as UpdateTempPasswordPageViewModel;
_vm.Page = this; _vm.Page = this;
SetActivityIndicator(); SetActivityIndicator();
// Actions Declaration // Actions Declaration
_vm.LogOutAction = () => _vm.LogOutAction = () =>
{ {
_messagingService.Send("logout"); _messagingService.Send("logout");
}; };
_vm.UpdateTempPasswordSuccessAction = () => Device.BeginInvokeOnMainThread(UpdateTempPasswordSuccess); _vm.UpdateTempPasswordSuccessAction = () => Device.BeginInvokeOnMainThread(UpdateTempPasswordSuccess);
// Link fields that will be referenced in codebehind // Link fields that will be referenced in codebehind
MasterPasswordEntry = _masterPassword; MasterPasswordEntry = _masterPassword;
ConfirmMasterPasswordEntry = _confirmMasterPassword; ConfirmMasterPasswordEntry = _confirmMasterPassword;
// Return Types and Commands // Return Types and Commands
_masterPassword.ReturnType = ReturnType.Next; _masterPassword.ReturnType = ReturnType.Next;
_masterPassword.ReturnCommand = new Command(() => _confirmMasterPassword.Focus()); _masterPassword.ReturnCommand = new Command(() => _confirmMasterPassword.Focus());
@ -77,7 +77,7 @@ namespace Bit.App.Pages
} }
} }
} }
private void UpdateTempPasswordSuccess() private void UpdateTempPasswordSuccess()
{ {
_messagingService.Send("logout"); _messagingService.Send("logout");

View File

@ -1,6 +1,6 @@
using Bit.App.Resources; using System;
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Resources;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Models.Request; using Bit.Core.Models.Request;
using Xamarin.Forms; using Xamarin.Forms;
@ -16,7 +16,7 @@ namespace Bit.App.Pages
ToggleConfirmPasswordCommand = new Command(ToggleConfirmPassword); ToggleConfirmPasswordCommand = new Command(ToggleConfirmPassword);
SubmitCommand = new Command(async () => await SubmitAsync()); SubmitCommand = new Command(async () => await SubmitAsync());
} }
public Command SubmitCommand { get; } public Command SubmitCommand { get; }
public Command TogglePasswordCommand { get; } public Command TogglePasswordCommand { get; }
public Command ToggleConfirmPasswordCommand { get; } public Command ToggleConfirmPasswordCommand { get; }
@ -37,23 +37,23 @@ namespace Bit.App.Pages
public async Task SubmitAsync() public async Task SubmitAsync()
{ {
if (!await ValidateMasterPasswordAsync()) if (!await ValidateMasterPasswordAsync())
{ {
return; return;
} }
// Retrieve details for key generation // Retrieve details for key generation
var kdf = await _stateService.GetKdfTypeAsync(); var kdf = await _stateService.GetKdfTypeAsync();
var kdfIterations = await _stateService.GetKdfIterationsAsync(); var kdfIterations = await _stateService.GetKdfIterationsAsync();
var email = await _stateService.GetEmailAsync(); var email = await _stateService.GetEmailAsync();
// Create new key and hash new password // Create new key and hash new password
var key = await _cryptoService.MakeKeyAsync(MasterPassword, email, kdf, kdfIterations); var key = await _cryptoService.MakeKeyAsync(MasterPassword, email, kdf, kdfIterations);
var masterPasswordHash = await _cryptoService.HashPasswordAsync(MasterPassword, key); var masterPasswordHash = await _cryptoService.HashPasswordAsync(MasterPassword, key);
// Create new encKey for the User // Create new encKey for the User
var newEncKey = await _cryptoService.RemakeEncKeyAsync(key); var newEncKey = await _cryptoService.RemakeEncKeyAsync(key);
// Create request // Create request
var request = new UpdateTempPasswordRequest var request = new UpdateTempPasswordRequest
{ {
@ -61,7 +61,7 @@ namespace Bit.App.Pages
NewMasterPasswordHash = masterPasswordHash, NewMasterPasswordHash = masterPasswordHash,
MasterPasswordHint = Hint MasterPasswordHint = Hint
}; };
// Initiate API action // Initiate API action
try try
{ {

View File

@ -36,7 +36,7 @@ namespace Bit.App.Pages
_logger = ServiceContainer.Resolve<ILogger>("logger"); _logger = ServiceContainer.Resolve<ILogger>("logger");
PageTitle = AppResources.VerificationCode; PageTitle = AppResources.VerificationCode;
TogglePasswordCommand = new Command(TogglePassword); TogglePasswordCommand = new Command(TogglePassword);
MainActionCommand = new AsyncCommand(MainActionAsync, allowsMultipleExecutions: false); MainActionCommand = new AsyncCommand(MainActionAsync, allowsMultipleExecutions: false);
RequestOTPCommand = new AsyncCommand(RequestOTPAsync, allowsMultipleExecutions: false); RequestOTPCommand = new AsyncCommand(RequestOTPAsync, allowsMultipleExecutions: false);
@ -60,7 +60,7 @@ namespace Bit.App.Pages
get => _mainActionText; get => _mainActionText;
set => SetProperty(ref _mainActionText, value); set => SetProperty(ref _mainActionText, value);
} }
public string SendCodeStatus public string SendCodeStatus
{ {
get => _sendCodeStatus; get => _sendCodeStatus;

View File

@ -35,12 +35,12 @@ namespace Bit.App.Pages
protected async override void OnAppearing() protected async override void OnAppearing()
{ {
base.OnAppearing(); base.OnAppearing();
if (IsThemeDirty) if (IsThemeDirty)
{ {
UpdateOnThemeChanged(); UpdateOnThemeChanged();
} }
await SaveActivityAsync(); await SaveActivityAsync();
} }

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;

View File

@ -31,7 +31,8 @@ namespace Bit.App.Pages
{ {
base.OnAppearing(); base.OnAppearing();
await LoadOnAppearedAsync(_mainLayout, true, async () => { await LoadOnAppearedAsync(_mainLayout, true, async () =>
{
await _vm.InitAsync(); await _vm.InitAsync();
}); });
} }

View File

@ -12,7 +12,7 @@ namespace Bit.App.Pages
public partial class GeneratorPage : BaseContentPage, IThemeDirtablePage public partial class GeneratorPage : BaseContentPage, IThemeDirtablePage
{ {
private readonly IBroadcasterService _broadcasterService; private readonly IBroadcasterService _broadcasterService;
private GeneratorPageViewModel _vm; private GeneratorPageViewModel _vm;
private readonly bool _fromTabPage; private readonly bool _fromTabPage;
private readonly Action<string> _selectAction; private readonly Action<string> _selectAction;
@ -77,7 +77,7 @@ namespace Bit.App.Pages
} }
}); });
} }
protected override void OnDisappearing() protected override void OnDisappearing()
{ {
base.OnDisappearing(); base.OnDisappearing();

View File

@ -1,10 +1,10 @@
using Bit.App.Resources; using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Resources;
using Bit.App.Utilities; using Bit.App.Utilities;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Models.Domain; using Bit.Core.Models.Domain;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages
@ -225,7 +225,7 @@ namespace Bit.App.Pages
} }
} }
} }
public PasswordGeneratorPolicyOptions EnforcedPolicyOptions public PasswordGeneratorPolicyOptions EnforcedPolicyOptions
{ {
get => _enforcedPolicyOptions; get => _enforcedPolicyOptions;

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Models; using Bit.App.Models;
@ -337,10 +337,10 @@ namespace Bit.App.Pages
_vm.IsAddFromShare = true; _vm.IsAddFromShare = true;
_vm.CopyInsteadOfShareAfterSaving = _appOptions.CopyInsteadOfShareAfterSaving; _vm.CopyInsteadOfShareAfterSaving = _appOptions.CopyInsteadOfShareAfterSaving;
var name = _appOptions.CreateSend.Item2; var name = _appOptions.CreateSend.Item2;
_vm.Send.Name = name; _vm.Send.Name = name;
var type = _appOptions.CreateSend.Item1; var type = _appOptions.CreateSend.Item1;
if (type == SendType.File) if (type == SendType.File)
{ {

View File

@ -40,7 +40,7 @@ namespace Bit.App.Pages
private TimeSpan? _expirationTime; private TimeSpan? _expirationTime;
private bool _isOverridingPickers; private bool _isOverridingPickers;
private int? _maxAccessCount; private int? _maxAccessCount;
private string[] _additionalSendProperties = new [] private string[] _additionalSendProperties = new[]
{ {
nameof(IsText), nameof(IsText),
nameof(IsFile), nameof(IsFile),
@ -209,7 +209,7 @@ namespace Bit.App.Pages
{ {
get => _showPassword; get => _showPassword;
set => SetProperty(ref _showPassword, value, set => SetProperty(ref _showPassword, value,
additionalPropertyNames: new [] additionalPropertyNames: new[]
{ {
nameof(ShowPasswordIcon) nameof(ShowPasswordIcon)
}); });
@ -237,7 +237,7 @@ namespace Bit.App.Pages
PageTitle = EditMode ? AppResources.EditSend : AppResources.AddSend; PageTitle = EditMode ? AppResources.EditSend : AppResources.AddSend;
_canAccessPremium = await _stateService.CanAccessPremiumAsync(); _canAccessPremium = await _stateService.CanAccessPremiumAsync();
_emailVerified = await _stateService.GetEmailVerifiedAsync(); _emailVerified = await _stateService.GetEmailVerifiedAsync();
SendEnabled = ! await AppHelpers.IsSendDisabledByPolicyAsync(); SendEnabled = !await AppHelpers.IsSendDisabledByPolicyAsync();
DisableHideEmail = await AppHelpers.IsHideEmailDisabledByPolicyAsync(); DisableHideEmail = await AppHelpers.IsHideEmailDisabledByPolicyAsync();
SendOptionsPolicyInEffect = SendEnabled && DisableHideEmail; SendOptionsPolicyInEffect = SendEnabled && DisableHideEmail;
} }
@ -381,7 +381,7 @@ namespace Bit.App.Pages
UpdateSendData(); UpdateSendData();
if (string.IsNullOrWhiteSpace(NewPassword)) if (string.IsNullOrWhiteSpace(NewPassword))
{ {
NewPassword = null; NewPassword = null;
} }
@ -521,7 +521,7 @@ namespace Bit.App.Pages
{ {
await _platformUtilsService.ShowDialogAsync(AppResources.SendFileEmailVerificationRequired); await _platformUtilsService.ShowDialogAsync(AppResources.SendFileEmailVerificationRequired);
} }
if (IsAddFromShare && Device.RuntimePlatform == Device.Android) if (IsAddFromShare && Device.RuntimePlatform == Device.Android)
{ {
_deviceActionService.CloseMainApp(); _deviceActionService.CloseMainApp();

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Controls; using Bit.App.Controls;
@ -133,7 +133,7 @@ namespace Bit.App.Pages
} }
} }
} }
private async void RowSelected(object sender, SelectionChangedEventArgs e) private async void RowSelected(object sender, SelectionChangedEventArgs e)
{ {
((ExtendedCollectionView)sender).SelectedItem = null; ((ExtendedCollectionView)sender).SelectedItem = null;
@ -174,7 +174,7 @@ namespace Bit.App.Pages
{ {
await _vaultTimeoutService.LockAsync(true, true); await _vaultTimeoutService.LockAsync(true, true);
} }
private void About_Clicked(object sender, EventArgs e) private void About_Clicked(object sender, EventArgs e)
{ {
_vm.ShowAbout(); _vm.ShowAbout();

View File

@ -9,6 +9,6 @@
} }
public string Title { get; } public string Title { get; }
public string ItemCount { get; } public string ItemCount { get; }
} }
} }

View File

@ -136,7 +136,7 @@ namespace Bit.App.Pages
ShowNoData = false; ShowNoData = false;
Loading = true; Loading = true;
ShowList = false; ShowList = false;
SendEnabled = ! await AppHelpers.IsSendDisabledByPolicyAsync(); SendEnabled = !await AppHelpers.IsSendDisabledByPolicyAsync();
var groupedSends = new List<SendGroupingsPageListGroup>(); var groupedSends = new List<SendGroupingsPageListGroup>();
var page = Page as SendGroupingsPage; var page = Page as SendGroupingsPage;

View File

@ -35,11 +35,11 @@ namespace Bit.App.Pages
get => _sendEnabled; get => _sendEnabled;
set => SetProperty(ref _sendEnabled, value); set => SetProperty(ref _sendEnabled, value);
} }
public bool ShowNoData public bool ShowNoData
{ {
get => _showNoData; get => _showNoData;
set => SetProperty(ref _showNoData, value, additionalPropertyNames: new [] set => SetProperty(ref _showNoData, value, additionalPropertyNames: new[]
{ {
nameof(ShowSearchDirection) nameof(ShowSearchDirection)
}); });
@ -48,7 +48,7 @@ namespace Bit.App.Pages
public bool ShowList public bool ShowList
{ {
get => _showList; get => _showList;
set => SetProperty(ref _showList, value, additionalPropertyNames: new [] set => SetProperty(ref _showList, value, additionalPropertyNames: new[]
{ {
nameof(ShowSearchDirection) nameof(ShowSearchDirection)
}); });
@ -58,7 +58,7 @@ namespace Bit.App.Pages
public async Task InitAsync() public async Task InitAsync()
{ {
SendEnabled = ! await AppHelpers.IsSendDisabledByPolicyAsync(); SendEnabled = !await AppHelpers.IsSendDisabledByPolicyAsync();
if (!string.IsNullOrWhiteSpace((Page as SendsPage).SearchBar.Text)) if (!string.IsNullOrWhiteSpace((Page as SendsPage).SearchBar.Text))
{ {
Search((Page as SendsPage).SearchBar.Text, 200); Search((Page as SendsPage).SearchBar.Text, 200);

View File

@ -49,12 +49,12 @@ namespace Bit.App.Pages
_vm.ToggleAutofillService(); _vm.ToggleAutofillService();
} }
} }
private void ToggleInlineAutofill(object sender, EventArgs e) private void ToggleInlineAutofill(object sender, EventArgs e)
{ {
_vm.ToggleInlineAutofill(); _vm.ToggleInlineAutofill();
} }
private void ToggleAccessibility(object sender, EventArgs e) private void ToggleAccessibility(object sender, EventArgs e)
{ {
if (DoOnce()) if (DoOnce())
@ -62,7 +62,7 @@ namespace Bit.App.Pages
_vm.ToggleAccessibility(); _vm.ToggleAccessibility();
} }
} }
private void ToggleDrawOver(object sender, EventArgs e) private void ToggleDrawOver(object sender, EventArgs e)
{ {
if (DoOnce()) if (DoOnce())

View File

@ -12,7 +12,7 @@ namespace Bit.App.Pages
private readonly IDeviceActionService _deviceActionService; private readonly IDeviceActionService _deviceActionService;
private readonly IStateService _stateService; private readonly IStateService _stateService;
private readonly MobileI18nService _i18nService; private readonly MobileI18nService _i18nService;
private bool _autofillServiceToggled; private bool _autofillServiceToggled;
private bool _inlineAutofillToggled; private bool _inlineAutofillToggled;
private bool _accessibilityToggled; private bool _accessibilityToggled;
@ -26,9 +26,9 @@ namespace Bit.App.Pages
_i18nService = ServiceContainer.Resolve<II18nService>("i18nService") as MobileI18nService; _i18nService = ServiceContainer.Resolve<II18nService>("i18nService") as MobileI18nService;
PageTitle = AppResources.AutofillServices; PageTitle = AppResources.AutofillServices;
} }
#region Autofill Service #region Autofill Service
public bool AutofillServiceVisible public bool AutofillServiceVisible
{ {
get => _deviceActionService.SystemMajorVersion() >= 26; get => _deviceActionService.SystemMajorVersion() >= 26;
@ -43,16 +43,16 @@ namespace Bit.App.Pages
nameof(InlineAutofillEnabled) nameof(InlineAutofillEnabled)
}); });
} }
#endregion #endregion
#region Inline Autofill #region Inline Autofill
public bool InlineAutofillVisible public bool InlineAutofillVisible
{ {
get => _deviceActionService.SystemMajorVersion() >= 30; get => _deviceActionService.SystemMajorVersion() >= 30;
} }
public bool InlineAutofillEnabled public bool InlineAutofillEnabled
{ {
get => AutofillServiceToggled; get => AutofillServiceToggled;
@ -69,9 +69,9 @@ namespace Bit.App.Pages
} }
} }
} }
#endregion #endregion
#region Accessibility #region Accessibility
public string AccessibilityDescriptionLabel public string AccessibilityDescriptionLabel
@ -97,7 +97,7 @@ namespace Bit.App.Pages
return _i18nService.T("AccessibilityDescription4"); return _i18nService.T("AccessibilityDescription4");
} }
} }
public bool AccessibilityToggled public bool AccessibilityToggled
{ {
get => _accessibilityToggled; get => _accessibilityToggled;
@ -109,9 +109,9 @@ namespace Bit.App.Pages
} }
#endregion #endregion
#region Draw-Over #region Draw-Over
public bool DrawOverVisible public bool DrawOverVisible
{ {
get => _deviceActionService.SystemMajorVersion() >= 23; get => _deviceActionService.SystemMajorVersion() >= 23;
@ -135,12 +135,12 @@ namespace Bit.App.Pages
return _i18nService.T("DrawOverDescription3"); return _i18nService.T("DrawOverDescription3");
} }
} }
public bool DrawOverEnabled public bool DrawOverEnabled
{ {
get => AccessibilityToggled; get => AccessibilityToggled;
} }
public bool DrawOverToggled public bool DrawOverToggled
{ {
get => _drawOverToggled; get => _drawOverToggled;
@ -148,7 +148,7 @@ namespace Bit.App.Pages
} }
#endregion #endregion
public async Task InitAsync() public async Task InitAsync()
{ {
InlineAutofillToggled = await _stateService.GetInlineAutofillEnabledAsync() ?? true; InlineAutofillToggled = await _stateService.GetInlineAutofillEnabledAsync() ?? true;
@ -189,7 +189,7 @@ namespace Bit.App.Pages
} }
_deviceActionService.OpenAccessibilityOverlayPermissionSettings(); _deviceActionService.OpenAccessibilityOverlayPermissionSettings();
} }
public void UpdateEnabled() public void UpdateEnabled()
{ {
AutofillServiceToggled = AutofillServiceToggled =
@ -197,7 +197,7 @@ namespace Bit.App.Pages
AccessibilityToggled = _deviceActionService.AutofillAccessibilityServiceRunning(); AccessibilityToggled = _deviceActionService.AutofillAccessibilityServiceRunning();
DrawOverToggled = _deviceActionService.AutofillAccessibilityOverlayPermitted(); DrawOverToggled = _deviceActionService.AutofillAccessibilityOverlayPermitted();
} }
private async Task UpdateInlineAutofillToggledAsync() private async Task UpdateInlineAutofillToggledAsync()
{ {
if (_inited) if (_inited)

View File

@ -4,11 +4,11 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Bit.Core;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages
@ -77,7 +77,7 @@ namespace Bit.App.Pages
InstructionText = _i18nService.T("ExportVaultMasterPasswordDescription"); InstructionText = _i18nService.T("ExportVaultMasterPasswordDescription");
SecretName = _i18nService.T("MasterPassword"); SecretName = _i18nService.T("MasterPassword");
} }
UpdateWarning(); UpdateWarning();
} }
@ -109,7 +109,7 @@ namespace Bit.App.Pages
{ {
get => _showPassword; get => _showPassword;
set => SetProperty(ref _showPassword, value, set => SetProperty(ref _showPassword, value,
additionalPropertyNames: new string[] {nameof(ShowPasswordIcon)}); additionalPropertyNames: new string[] { nameof(ShowPasswordIcon) });
} }
public bool UseOTPVerification public bool UseOTPVerification

View File

@ -1,7 +1,7 @@
using Bit.App.Resources; using System.Threading.Tasks;
using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Threading.Tasks;
namespace Bit.App.Pages namespace Bit.App.Pages
{ {

View File

@ -1,5 +1,5 @@
using Bit.App.Resources; using System.Collections.Generic;
using System.Collections.Generic; using Bit.App.Resources;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages

View File

@ -1,10 +1,10 @@
using Bit.App.Abstractions; using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Threading.Tasks;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages

View File

@ -1,7 +1,7 @@
using Bit.Core.Models.View; using System;
using System;
using System.Linq; using System.Linq;
using Bit.App.Controls; using Bit.App.Controls;
using Bit.Core.Models.View;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages

View File

@ -1,10 +1,10 @@
using Bit.App.Resources; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Bit.App.Pages namespace Bit.App.Pages
{ {

View File

@ -1,11 +1,11 @@
using Bit.App.Resources; using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Resources;
using Bit.App.Utilities; using Bit.App.Utilities;
using Bit.Core; using Bit.Core;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages

View File

@ -59,7 +59,7 @@ namespace Bit.App.Pages
async void OnTimePickerPropertyChanged(object sender, PropertyChangedEventArgs args) async void OnTimePickerPropertyChanged(object sender, PropertyChangedEventArgs args)
{ {
var s = (TimePicker) sender; var s = (TimePicker)sender;
var time = s.Time.TotalMinutes; var time = s.Time.TotalMinutes;
if (s.IsFocused && args.PropertyName == "Time") if (s.IsFocused && args.PropertyName == "Time")
{ {

View File

@ -1,16 +1,16 @@
using Bit.App.Abstractions; using System;
using Bit.App.Resources;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Resources;
using Bit.Core.Abstractions;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Models.Domain; using Bit.Core.Models.Domain;
using Bit.Core.Utilities;
using Xamarin.CommunityToolkit.ObjectModel;
using Xamarin.Forms; using Xamarin.Forms;
using ZXing.Client.Result; using ZXing.Client.Result;
using Xamarin.CommunityToolkit.ObjectModel;
namespace Bit.App.Pages namespace Bit.App.Pages
{ {
@ -428,7 +428,7 @@ namespace Bit.App.Pages
var securityItems = new List<SettingsPageListItem> var securityItems = new List<SettingsPageListItem>
{ {
new SettingsPageListItem { Name = AppResources.VaultTimeout, SubLabel = _vaultTimeoutDisplayValue }, new SettingsPageListItem { Name = AppResources.VaultTimeout, SubLabel = _vaultTimeoutDisplayValue },
new SettingsPageListItem new SettingsPageListItem
{ {
Name = AppResources.VaultTimeoutAction, Name = AppResources.VaultTimeoutAction,
SubLabel = _vaultTimeoutActionDisplayValue SubLabel = _vaultTimeoutActionDisplayValue

View File

@ -1,9 +1,9 @@
using Bit.App.Abstractions; using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Threading.Tasks;
namespace Bit.App.Pages namespace Bit.App.Pages
{ {

View File

@ -12,7 +12,7 @@ namespace Bit.App.Pages
{ {
private readonly IMessagingService _messagingService; private readonly IMessagingService _messagingService;
private readonly IKeyConnectorService _keyConnectorService; private readonly IKeyConnectorService _keyConnectorService;
private NavigationPage _groupingsPage; private NavigationPage _groupingsPage;
private NavigationPage _sendGroupingsPage; private NavigationPage _sendGroupingsPage;
private NavigationPage _generatorPage; private NavigationPage _generatorPage;
@ -93,7 +93,7 @@ namespace Bit.App.Pages
{ {
CurrentPage = _generatorPage; CurrentPage = _generatorPage;
} }
public void ResetToSendPage() public void ResetToSendPage()
{ {
CurrentPage = _sendGroupingsPage; CurrentPage = _sendGroupingsPage;

View File

@ -1,12 +1,12 @@
using Bit.App.Abstractions; using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Models; using Bit.App.Models;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.App.Utilities; using Bit.App.Utilities;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xamarin.Essentials; using Xamarin.Essentials;
using Xamarin.Forms; using Xamarin.Forms;
using Xamarin.Forms.PlatformConfiguration; using Xamarin.Forms.PlatformConfiguration;

View File

@ -65,7 +65,7 @@ namespace Bit.App.Pages
new KeyValuePair<UriMatchType?, string>(UriMatchType.Exact, AppResources.Exact), new KeyValuePair<UriMatchType?, string>(UriMatchType.Exact, AppResources.Exact),
new KeyValuePair<UriMatchType?, string>(UriMatchType.Never, AppResources.Never) new KeyValuePair<UriMatchType?, string>(UriMatchType.Never, AppResources.Never)
}; };
public AddEditPageViewModel() public AddEditPageViewModel()
{ {
_deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService"); _deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
@ -350,7 +350,7 @@ namespace Bit.App.Pages
{ {
Cipher.Name += " - " + AppResources.Clone; Cipher.Name += " - " + AppResources.Clone;
// If not allowing personal ownership, update cipher's org Id to prompt downstream changes // If not allowing personal ownership, update cipher's org Id to prompt downstream changes
if (Cipher.OrganizationId == null && !AllowPersonal) if (Cipher.OrganizationId == null && !AllowPersonal)
{ {
Cipher.OrganizationId = OrganizationId; Cipher.OrganizationId = OrganizationId;
} }
@ -399,7 +399,7 @@ namespace Bit.App.Pages
IdentityTitleOptions.FindIndex(k => k.Value == Cipher.Identity.Title); IdentityTitleOptions.FindIndex(k => k.Value == Cipher.Identity.Title);
OwnershipSelectedIndex = string.IsNullOrWhiteSpace(Cipher.OrganizationId) ? 0 : OwnershipSelectedIndex = string.IsNullOrWhiteSpace(Cipher.OrganizationId) ? 0 :
OwnershipOptions.FindIndex(k => k.Value == Cipher.OrganizationId); OwnershipOptions.FindIndex(k => k.Value == Cipher.OrganizationId);
// If the selected organization is on Index 0 and we've removed the personal option, force refresh // If the selected organization is on Index 0 and we've removed the personal option, force refresh
if (!AllowPersonal && OwnershipSelectedIndex == 0) if (!AllowPersonal && OwnershipSelectedIndex == 0)
{ {
@ -451,11 +451,11 @@ namespace Bit.App.Pages
AppResources.Ok); AppResources.Ok);
return false; return false;
} }
if ((!EditMode || CloneMode) && !AllowPersonal && string.IsNullOrWhiteSpace(Cipher.OrganizationId)) if ((!EditMode || CloneMode) && !AllowPersonal && string.IsNullOrWhiteSpace(Cipher.OrganizationId))
{ {
await Page.DisplayAlert(AppResources.AnErrorHasOccurred, await Page.DisplayAlert(AppResources.AnErrorHasOccurred,
AppResources.PersonalOwnershipSubmitError,AppResources.Ok); AppResources.PersonalOwnershipSubmitError, AppResources.Ok);
return false; return false;
} }
@ -535,7 +535,7 @@ namespace Bit.App.Pages
AppResources.AnErrorHasOccurred); AppResources.AnErrorHasOccurred);
} }
} }
catch(Exception genex) catch (Exception genex)
{ {
_logger.Exception(genex); _logger.Exception(genex);
await _deviceActionService.HideLoadingAsync(); await _deviceActionService.HideLoadingAsync();

View File

@ -1,6 +1,6 @@
using Bit.Core.Abstractions; using System;
using Bit.Core.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages

View File

@ -1,13 +1,13 @@
using Bit.App.Abstractions; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Models.Domain; using Bit.Core.Models.Domain;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages

View File

@ -1,12 +1,12 @@
using Bit.App.Models; using System;
using Bit.Core.Abstractions;
using Bit.Core.Enums;
using Bit.Core.Utilities;
using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Controls; using Bit.App.Controls;
using Bit.App.Models;
using Bit.App.Utilities; using Bit.App.Utilities;
using Bit.Core.Abstractions;
using Bit.Core.Enums;
using Bit.Core.Utilities;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages
@ -72,14 +72,14 @@ namespace Bit.App.Pages
}); });
} }
}); });
await LoadOnAppearedAsync(_mainLayout, false, async () => await LoadOnAppearedAsync(_mainLayout, false, async () =>
{ {
try try
{ {
await _vm.LoadAsync(); await _vm.LoadAsync();
} }
catch (Exception e) when(e.Message.Contains("No key.")) catch (Exception e) when (e.Message.Contains("No key."))
{ {
await Task.Delay(1000); await Task.Delay(1000);
await _vm.LoadAsync(); await _vm.LoadAsync();

View File

@ -1,4 +1,8 @@
using Bit.App.Abstractions; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Controls;
using Bit.App.Models; using Bit.App.Models;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.App.Utilities; using Bit.App.Utilities;
@ -8,11 +12,7 @@ using Bit.Core.Enums;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xamarin.CommunityToolkit.ObjectModel; using Xamarin.CommunityToolkit.ObjectModel;
using Bit.App.Controls;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages
@ -44,7 +44,7 @@ namespace Bit.App.Pages
GroupedItems = new ObservableRangeCollection<IGroupingsPageListItem>(); GroupedItems = new ObservableRangeCollection<IGroupingsPageListItem>();
CipherOptionsCommand = new Command<CipherView>(CipherOptionsAsync); CipherOptionsCommand = new Command<CipherView>(CipherOptionsAsync);
AccountSwitchingOverlayViewModel = new AccountSwitchingOverlayViewModel(_stateService, _messagingService, _logger) AccountSwitchingOverlayViewModel = new AccountSwitchingOverlayViewModel(_stateService, _messagingService, _logger)
{ {
AllowAddAccountRow = false AllowAddAccountRow = false

View File

@ -1,10 +1,10 @@
using Bit.App.Abstractions; using System;
using System.Linq;
using Bit.App.Abstractions;
using Bit.App.Controls;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System;
using System.Linq;
using Bit.App.Controls;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages

View File

@ -1,4 +1,9 @@
using Bit.App.Abstractions; using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core; using Bit.Core;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
@ -6,11 +11,6 @@ using Bit.Core.Enums;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages
@ -107,7 +107,7 @@ namespace Bit.App.Pages
} }
try try
{ {
ciphers = await _searchService.SearchCiphersAsync(searchText, ciphers = await _searchService.SearchCiphersAsync(searchText,
Filter ?? (c => c.IsDeleted == Deleted), null, cts.Token); Filter ?? (c => c.IsDeleted == Deleted), null, cts.Token);
cts.Token.ThrowIfCancellationRequested(); cts.Token.ThrowIfCancellationRequested();
} }

View File

@ -1,13 +1,13 @@
using Bit.App.Abstractions; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Models.Domain; using Bit.Core.Models.Domain;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Bit.App.Pages namespace Bit.App.Pages
{ {

View File

@ -27,7 +27,7 @@ namespace Bit.App.Pages
private PreviousPageInfo _previousPage; private PreviousPageInfo _previousPage;
public GroupingsPage(bool mainPage, CipherType? type = null, string folderId = null, public GroupingsPage(bool mainPage, CipherType? type = null, string folderId = null,
string collectionId = null, string pageTitle = null, PreviousPageInfo previousPage = null, string collectionId = null, string pageTitle = null, PreviousPageInfo previousPage = null,
bool deleted = false) bool deleted = false)
{ {
_pageName = string.Concat(nameof(GroupingsPage), "_", DateTime.UtcNow.Ticks); _pageName = string.Concat(nameof(GroupingsPage), "_", DateTime.UtcNow.Ticks);
@ -117,7 +117,7 @@ namespace Bit.App.Pages
{ {
await _vm.LoadAsync(); await _vm.LoadAsync();
} }
catch (Exception e) when(e.Message.Contains("No key.")) catch (Exception e) when (e.Message.Contains("No key."))
{ {
await Task.Delay(1000); await Task.Delay(1000);
await _vm.LoadAsync(); await _vm.LoadAsync();

View File

@ -23,7 +23,8 @@ namespace Bit.App.Pages
protected override async void OnAppearing() protected override async void OnAppearing()
{ {
base.OnAppearing(); base.OnAppearing();
await LoadOnAppearedAsync(_mainLayout, true, async () => { await LoadOnAppearedAsync(_mainLayout, true, async () =>
{
await _vm.InitAsync(); await _vm.InitAsync();
}); });
} }

View File

@ -1,9 +1,9 @@
using Bit.App.Resources; using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages

View File

@ -1,13 +1,13 @@
using Bit.App.Abstractions; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Bit.App.Pages namespace Bit.App.Pages
{ {

View File

@ -1,9 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages
@ -216,7 +216,7 @@ namespace Bit.App.Pages
return; return;
} }
var options = new List<string> {AppResources.Attachments}; var options = new List<string> { AppResources.Attachments };
if (_vm.Cipher.OrganizationId == null) if (_vm.Cipher.OrganizationId == null)
{ {
options.Add(AppResources.Clone); options.Add(AppResources.Clone);

View File

@ -1,16 +1,16 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.App.Utilities; using Bit.App.Utilities;
using Bit.Core;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Bit.Core;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages
@ -233,7 +233,7 @@ namespace Bit.App.Pages
set set
{ {
SetProperty(ref _totpLow, value); SetProperty(ref _totpLow, value);
Page.Resources["textTotp"] = ThemeManager.Resources()[value ? "text-danger" : "text-default"]; Page.Resources["textTotp"] = ThemeManager.Resources()[value ? "text-danger" : "text-default"];
} }
} }
public bool IsDeleted => Cipher.IsDeleted; public bool IsDeleted => Cipher.IsDeleted;
@ -285,7 +285,7 @@ namespace Bit.App.Pages
public async void TogglePassword() public async void TogglePassword()
{ {
if (! await PromptPasswordAsync()) if (!await PromptPasswordAsync())
{ {
return; return;
} }
@ -613,7 +613,7 @@ namespace Bit.App.Pages
_attachmentData = null; _attachmentData = null;
_attachmentFilename = null; _attachmentFilename = null;
} }
private async void CopyAsync(string id, string text = null) private async void CopyAsync(string id, string text = null)
{ {
if (_passwordRepromptService.ProtectedFields.Contains(id) && !await PromptPasswordAsync()) if (_passwordRepromptService.ProtectedFields.Contains(id) && !await PromptPasswordAsync())

View File

@ -1,11 +1,11 @@
using Bit.App.Resources; using System;
using Bit.Core.Abstractions;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Reflection; using System.Reflection;
using System.Resources; using System.Resources;
using System.Threading; using System.Threading;
using Bit.App.Resources;
using Bit.Core.Abstractions;
namespace Bit.App.Services namespace Bit.App.Services
{ {

View File

@ -1,8 +1,8 @@
using System.Threading.Tasks; using System;
using System.Threading.Tasks;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using System;
using Bit.Core.Utilities; using Bit.Core.Utilities;
namespace Bit.App.Services namespace Bit.App.Services

View File

@ -14,7 +14,7 @@ using Xamarin.Forms;
namespace Bit.App.Services namespace Bit.App.Services
{ {
public class MobilePlatformUtilsService : IPlatformUtilsService public class MobilePlatformUtilsService : IPlatformUtilsService
{ {
private static readonly Random _random = new Random(); private static readonly Random _random = new Random();
private const int DialogPromiseExpiration = 600000; // 10 minutes private const int DialogPromiseExpiration = 600000; // 10 minutes

View File

@ -1,8 +1,8 @@
using Bit.Core; using System;
using Bit.Core.Abstractions;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.Core;
using Bit.Core.Abstractions;
namespace Bit.App.Services namespace Bit.App.Services
{ {

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json.Linq; using System.Threading.Tasks;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using System.Threading.Tasks; using Newtonsoft.Json.Linq;
namespace Bit.App.Services namespace Bit.App.Services
{ {

View File

@ -1,15 +1,15 @@
using Bit.Core.Abstractions; using System;
using System.Threading.Tasks;
using Bit.Core.Abstractions;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
using System;
using System.Threading.Tasks;
namespace Bit.App.Services namespace Bit.App.Services
{ {
public class PreferencesStorageService : IStorageService public class PreferencesStorageService : IStorageService
{ {
public static string KeyFormat = "bwPreferencesStorage:{0}"; public static string KeyFormat = "bwPreferencesStorage:{0}";
private readonly string _sharedName; private readonly string _sharedName;
private readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings private readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
{ {

View File

@ -1,17 +1,17 @@
#if !FDROID #if !FDROID
using System;
using System.Diagnostics; using System.Diagnostics;
using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.Core;
using Bit.Core.Abstractions;
using Bit.Core.Enums;
using Bit.Core.Exceptions;
using Bit.Core.Models.Response;
using Bit.Core.Utilities;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Bit.App.Abstractions;
using System;
using Xamarin.Forms; using Xamarin.Forms;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using System.Threading.Tasks;
using Bit.Core.Enums;
using Bit.Core;
using Bit.Core.Models.Response;
using Bit.Core.Exceptions;
namespace Bit.App.Services namespace Bit.App.Services
{ {

View File

@ -1,7 +1,7 @@
using Bit.Core.Abstractions; using System.Threading.Tasks;
using Bit.Core.Abstractions;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
using System.Threading.Tasks;
namespace Bit.App.Services namespace Bit.App.Services
{ {

View File

@ -9,4 +9,4 @@ namespace Bit.App.Styles
InitializeComponent(); InitializeComponent();
} }
} }
} }

View File

@ -9,4 +9,4 @@ namespace Bit.App.Styles
InitializeComponent(); InitializeComponent();
} }
} }
} }

View File

@ -9,4 +9,4 @@ namespace Bit.App.Styles
InitializeComponent(); InitializeComponent();
} }
} }
} }

View File

@ -9,4 +9,4 @@ namespace Bit.App.Styles
InitializeComponent(); InitializeComponent();
} }
} }
} }

View File

@ -9,4 +9,4 @@ namespace Bit.App.Styles
InitializeComponent(); InitializeComponent();
} }
} }
} }

View File

@ -9,4 +9,4 @@ namespace Bit.App.Styles
InitializeComponent(); InitializeComponent();
} }
} }
} }

View File

@ -9,4 +9,4 @@ namespace Bit.App.Styles
InitializeComponent(); InitializeComponent();
} }
} }
} }

View File

@ -1,21 +1,21 @@
using System; using System;
using System.Net;
using Bit.App.Abstractions;
using Bit.App.Pages;
using Bit.App.Resources;
using Bit.Core.Abstractions;
using Bit.Core.Models.View;
using Bit.Core.Utilities;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Controls; using Bit.App.Controls;
using Bit.App.Models; using Bit.App.Models;
using Bit.App.Pages;
using Bit.App.Resources;
using Bit.Core.Abstractions;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Models.Data; using Bit.Core.Models.Data;
using Bit.Core.Models.View;
using Bit.Core.Utilities;
using Newtonsoft.Json; using Newtonsoft.Json;
using Xamarin.Essentials; using Xamarin.Essentials;
using Xamarin.Forms; using Xamarin.Forms;
@ -279,7 +279,7 @@ namespace Bit.App.Utilities
Subject = send.Name Subject = send.Name
}); });
} }
private static string GetSendUrl(SendView send) private static string GetSendUrl(SendView send)
{ {
var environmentService = ServiceContainer.Resolve<IEnvironmentService>("environmentService"); var environmentService = ServiceContainer.Resolve<IEnvironmentService>("environmentService");
@ -465,12 +465,12 @@ namespace Bit.App.Utilities
public static async Task<int> IncrementInvalidUnlockAttemptsAsync() public static async Task<int> IncrementInvalidUnlockAttemptsAsync()
{ {
var stateService = ServiceContainer.Resolve<IStateService>("stateService"); var stateService = ServiceContainer.Resolve<IStateService>("stateService");
var invalidUnlockAttempts = await stateService.GetInvalidUnlockAttemptsAsync(); var invalidUnlockAttempts = await stateService.GetInvalidUnlockAttemptsAsync();
invalidUnlockAttempts++; invalidUnlockAttempts++;
await stateService.SetInvalidUnlockAttemptsAsync(invalidUnlockAttempts); await stateService.SetInvalidUnlockAttemptsAsync(invalidUnlockAttempts);
return invalidUnlockAttempts; return invalidUnlockAttempts;
} }
public static async Task ResetInvalidUnlockAttemptsAsync() public static async Task ResetInvalidUnlockAttemptsAsync()
{ {
var stateService = ServiceContainer.Resolve<IStateService>("stateService"); var stateService = ServiceContainer.Resolve<IStateService>("stateService");

View File

@ -1,6 +1,6 @@
using Bit.Core.Abstractions; using System;
using Bit.Core.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System;
using Xamarin.Forms; using Xamarin.Forms;
using Xamarin.Forms.Xaml; using Xamarin.Forms.Xaml;

View File

@ -42,7 +42,7 @@ namespace Bit.App.Utilities
{ {
result += "<div style=\"display:inline-block; align-items:center; justify-content:center; text-align:center; word-break:break-all; white-space:pre-wrap; min-width:0\">"; result += "<div style=\"display:inline-block; align-items:center; justify-content:center; text-align:center; word-break:break-all; white-space:pre-wrap; min-width:0\">";
} }
// Start with an otherwise uncovered case so we will definitely enter the "something changed" // Start with an otherwise uncovered case so we will definitely enter the "something changed"
// state. // state.
var currentType = CharType.None; var currentType = CharType.None;
@ -72,7 +72,7 @@ namespace Bit.App.Utilities
{ {
result += "</span>"; result += "</span>";
} }
currentType = charType; currentType = charType;
// Switch the color if it is not a normal text. Otherwise leave the // Switch the color if it is not a normal text. Otherwise leave the
@ -110,13 +110,13 @@ namespace Bit.App.Utilities
{ {
result += "</span>"; result += "</span>";
} }
// Close off iOS div // Close off iOS div
if (Device.RuntimePlatform == Device.iOS) if (Device.RuntimePlatform == Device.iOS)
{ {
result += "</div>"; result += "</div>";
} }
return result; return result;
} }
} }

View File

@ -1,10 +1,10 @@
using Bit.Core.Models.Domain; using System;
using Bit.Core.Models.Request;
using Bit.Core.Models.Response;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.Core.Models.Domain;
using Bit.Core.Models.Request;
using Bit.Core.Models.Response;
namespace Bit.Core.Abstractions namespace Bit.Core.Abstractions
{ {

View File

@ -9,4 +9,4 @@ namespace Bit.Core.Abstractions
Task<List<BreachAccountResponse>> BreachedAccountsAsync(string username); Task<List<BreachAccountResponse>> BreachedAccountsAsync(string username);
Task<int> PasswordLeakedAsync(string password); Task<int> PasswordLeakedAsync(string password);
} }
} }

View File

@ -1,5 +1,5 @@
using Bit.Core.Models.Domain; using System;
using System; using Bit.Core.Models.Domain;
namespace Bit.Core.Abstractions namespace Bit.Core.Abstractions
{ {
@ -9,4 +9,4 @@ namespace Bit.Core.Abstractions
void Subscribe(string id, Action<Message> messageCallback); void Subscribe(string id, Action<Message> messageCallback);
void Unsubscribe(string id); void Unsubscribe(string id);
} }
} }

View File

@ -20,7 +20,7 @@ namespace Bit.Core.Abstractions
Task<Cipher> EncryptAsync(CipherView model, SymmetricCryptoKey key = null, Cipher originalCipher = null); Task<Cipher> EncryptAsync(CipherView model, SymmetricCryptoKey key = null, Cipher originalCipher = null);
Task<List<Cipher>> GetAllAsync(); Task<List<Cipher>> GetAllAsync();
Task<List<CipherView>> GetAllDecryptedAsync(); Task<List<CipherView>> GetAllDecryptedAsync();
Task<Tuple<List<CipherView>, List<CipherView>, List<CipherView>>> GetAllDecryptedByUrlAsync(string url, Task<Tuple<List<CipherView>, List<CipherView>, List<CipherView>>> GetAllDecryptedByUrlAsync(string url,
List<CipherType> includeOtherTypes = null); List<CipherType> includeOtherTypes = null);
Task<List<CipherView>> GetAllDecryptedForGroupingAsync(string groupingId, bool folder = true); Task<List<CipherView>> GetAllDecryptedForGroupingAsync(string groupingId, bool folder = true);
Task<List<CipherView>> GetAllDecryptedForUrlAsync(string url); Task<List<CipherView>> GetAllDecryptedForUrlAsync(string url);

View File

@ -1,6 +1,6 @@
using Bit.Core.Enums; using System;
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.Core.Enums;
namespace Bit.Core.Abstractions namespace Bit.Core.Abstractions
{ {

View File

@ -18,4 +18,4 @@ namespace Bit.Core.Abstractions
Task<EnvironmentUrlData> SetUrlsAsync(EnvironmentUrlData urls); Task<EnvironmentUrlData> SetUrlsAsync(EnvironmentUrlData urls);
Task SetUrlsFromStorageAsync(); Task SetUrlsFromStorageAsync();
} }
} }

View File

@ -1,4 +1,4 @@
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Bit.Core.Abstractions namespace Bit.Core.Abstractions
{ {

View File

@ -1,9 +1,11 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.Core.Models.Domain; using Bit.Core.Models.Domain;
using Bit.Core.Models.Response; using Bit.Core.Models.Response;
namespace Bit.Core.Abstractions { namespace Bit.Core.Abstractions
public interface IFileUploadService { {
public interface IFileUploadService
{
Task UploadCipherAttachmentFileAsync(AttachmentUploadDataResponse uploadData, EncString fileName, EncByteArray encryptedFileData); Task UploadCipherAttachmentFileAsync(AttachmentUploadDataResponse uploadData, EncString fileName, EncByteArray encryptedFileData);
Task UploadSendFileAsync(SendFileUploadDataResponse uploadData, EncString fileName, EncByteArray encryptedFileData); Task UploadSendFileAsync(SendFileUploadDataResponse uploadData, EncString fileName, EncByteArray encryptedFileData);
} }

View File

@ -4,4 +4,4 @@
{ {
void Send(string subscriber, object arg = null); void Send(string subscriber, object arg = null);
} }
} }

View File

@ -7,4 +7,4 @@
void Info(string message); void Info(string message);
void Warning(string message); void Warning(string message);
} }
} }

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.Core.Enums; using Bit.Core.Enums;

View File

@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.Core.Models.Data; using Bit.Core.Models.Data;
using Bit.Core.Models.Domain; using Bit.Core.Models.Domain;

View File

@ -8,4 +8,4 @@ namespace Bit.Core.Abstractions
int GetTimeInterval(string key); int GetTimeInterval(string key);
Task<bool> IsAutoCopyEnabledAsync(); Task<bool> IsAutoCopyEnabledAsync();
} }
} }

View File

@ -1,4 +1,4 @@
namespace Bit.Core namespace Bit.Core
{ {
public static class BitwardenIcons public static class BitwardenIcons
{ {

Some files were not shown because too many files have changed in this diff Show More