public RegisterPage(HomePage homePage) : base(updateActivity: false, requireAuth: false) { _homePage = homePage; _cryptoService = Resolver.Resolve <ICryptoService>(); _deviceActionService = Resolver.Resolve <IDeviceActionService>(); _accountsApiRepository = Resolver.Resolve <IAccountsApiRepository>(); _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>(); Init(); }
public ToolsPasswordGeneratorPage(Action <string> passwordValueAction = null, bool fromAutofill = false) { _passwordGenerationService = Resolver.Resolve <IPasswordGenerationService>(); _settings = Resolver.Resolve <ISettings>(); _deviceActionService = Resolver.Resolve <IDeviceActionService>(); _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>(); _passwordValueAction = passwordValueAction; _fromAutofill = fromAutofill; Init(); }
private void SetServices() { if (_storageService == null) { _storageService = ServiceContainer.Resolve <IStorageService>("storageService"); } if (_deviceActionService == null) { _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); } }
public MobilePlatformUtilsService( IDeviceActionService deviceActionService, IClipboardService clipboardService, IMessagingService messagingService, IBroadcasterService broadcasterService) { _deviceActionService = deviceActionService; _clipboardService = clipboardService; _messagingService = messagingService; _broadcasterService = broadcasterService; }
public VaultAttachmentsPage(string cipherId) : base(true) { _cipherId = cipherId; _cipherService = Resolver.Resolve <ICipherService>(); _connectivity = Resolver.Resolve <IConnectivity>(); _deviceActionService = Resolver.Resolve <IDeviceActionService>(); _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>(); _cryptoService = Resolver.Resolve <ICryptoService>(); Init(); }
public AttachmentsPageViewModel() { _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _cipherService = ServiceContainer.Resolve <ICipherService>("cipherService"); _cryptoService = ServiceContainer.Resolve <ICryptoService>("cryptoService"); _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService"); _userService = ServiceContainer.Resolve <IUserService>("userService"); _timeoutService = ServiceContainer.Resolve <IVaultTimeoutService>("vaultTimeoutService"); Attachments = new ExtendedObservableCollection <AttachmentView>(); DeleteAttachmentCommand = new Command <AttachmentView>(DeleteAsync); PageTitle = AppResources.Attachments; }
public DeleteAccountActionFlowExecutioner(IApiService apiService, IMessagingService messagingService, IPlatformUtilsService platformUtilsService, IDeviceActionService deviceActionService, ILogger logger) { _apiService = apiService; _messagingService = messagingService; _platformUtilsService = platformUtilsService; _deviceActionService = deviceActionService; _logger = logger; }
public override void ViewDidLoad() { _lockService = ServiceContainer.Resolve <ILockService>("lockService"); _cryptoService = ServiceContainer.Resolve <ICryptoService>("cryptoService"); _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _userService = ServiceContainer.Resolve <IUserService>("userService"); _storageService = ServiceContainer.Resolve <IStorageService>("storageService"); _secureStorageService = ServiceContainer.Resolve <IStorageService>("secureStorageService"); _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService"); _pinSet = _lockService.IsPinLockSetAsync().GetAwaiter().GetResult(); _hasKey = _cryptoService.HasKeyAsync().GetAwaiter().GetResult(); _pinLock = (_pinSet.Item1 && _hasKey) || _pinSet.Item2; _fingerprintLock = _lockService.IsFingerprintLockSetAsync().GetAwaiter().GetResult(); BaseNavItem.Title = _pinLock ? AppResources.VerifyPIN : AppResources.VerifyMasterPassword; BaseCancelButton.Title = AppResources.Cancel; BaseSubmitButton.Title = AppResources.Submit; var descriptor = UIFontDescriptor.PreferredBody; MasterPasswordCell.Label.Text = _pinLock ? AppResources.PIN : AppResources.MasterPassword; MasterPasswordCell.TextField.SecureTextEntry = true; MasterPasswordCell.TextField.ReturnKeyType = UIReturnKeyType.Go; MasterPasswordCell.TextField.ShouldReturn += (UITextField tf) => { CheckPasswordAsync().GetAwaiter().GetResult(); return(true); }; if (_pinLock) { MasterPasswordCell.TextField.KeyboardType = UIKeyboardType.NumberPad; } TableView.RowHeight = UITableView.AutomaticDimension; TableView.EstimatedRowHeight = 70; TableView.Source = new TableSource(this); TableView.AllowsSelection = true; base.ViewDidLoad(); if (_fingerprintLock) { var fingerprintButtonText = _deviceActionService.SupportsFaceId() ? AppResources.UseFaceIDToUnlock : AppResources.UseFingerprintToUnlock; // TODO: set button text var tasks = Task.Run(async() => { await Task.Delay(500); NSRunLoop.Main.BeginInvokeOnMainThread(async() => await PromptFingerprintAsync()); }); } }
public CiphersPageViewModel() { _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService"); _cipherService = ServiceContainer.Resolve <ICipherService>("cipherService"); _searchService = ServiceContainer.Resolve <ISearchService>("searchService"); _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _stateService = ServiceContainer.Resolve <IStateService>("stateService"); _passwordRepromptService = ServiceContainer.Resolve <IPasswordRepromptService>("passwordRepromptService"); Ciphers = new ExtendedObservableCollection <CipherView>(); CipherOptionsCommand = new Command <CipherView>(CipherOptionsAsync); }
public LoginPageViewModel() { _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _authService = ServiceContainer.Resolve <IAuthService>("authService"); _syncService = ServiceContainer.Resolve <ISyncService>("syncService"); _storageService = ServiceContainer.Resolve <IStorageService>("storageService"); _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService"); PageTitle = AppResources.Bitwarden; TogglePasswordCommand = new Command(TogglePassword); LogInCommand = new Command(async() => await LogInAsync()); }
public VaultEditCipherPage(string cipherId) { _cipherId = cipherId; _cipherService = Resolver.Resolve <ICipherService>(); _folderService = Resolver.Resolve <IFolderService>(); _deviceActionService = Resolver.Resolve <IDeviceActionService>(); _connectivity = Resolver.Resolve <IConnectivity>(); _deviceInfo = Resolver.Resolve <IDeviceInfoService>(); _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>(); Init(); }
public AbstractDeviceActionController( ApiSettings settings, ILogger <AbstractDeviceActionController> logger, ITransactionCoordinator transactionCoordinator, IDeviceActionService deviceActionService, IApiDeviceActionModelMapper deviceActionModelMapper ) : base(settings, logger, transactionCoordinator) { this.DeviceActionService = deviceActionService; this.DeviceActionModelMapper = deviceActionModelMapper; }
public RegisterPageViewModel() { _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _apiService = ServiceContainer.Resolve <IApiService>("apiService"); _cryptoService = ServiceContainer.Resolve <ICryptoService>("cryptoService"); _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService"); PageTitle = AppResources.CreateAccount; TogglePasswordCommand = new Command(TogglePassword); ToggleConfirmPasswordCommand = new Command(ToggleConfirmPassword); SubmitCommand = new Command(async() => await SubmitAsync()); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Forms.Init(); InitApp(); Bootstrap(); _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _messagingService = ServiceContainer.Resolve <IMessagingService>("messagingService"); _broadcasterService = ServiceContainer.Resolve <IBroadcasterService>("broadcasterService"); _storageService = ServiceContainer.Resolve <IStorageService>("storageService"); LoadApplication(new App.App(null)); AppearanceAdjustments(); ZXing.Net.Mobile.Forms.iOS.Platform.Init(); _broadcasterService.Subscribe(nameof(AppDelegate), (message) => { if (message.Command == "scheduleLockTimer") { var lockOptionMinutes = (int)message.Data; } else if (message.Command == "cancelLockTimer") { } else if (message.Command == "updatedTheme") { // ThemeManager.SetThemeStyle(message.Data as string); } else if (message.Command == "copiedToClipboard") { } else if (message.Command == "listenYubiKeyOTP") { ListenYubiKey((bool)message.Data); } else if (message.Command == "showAppExtension") { } else if (message.Command == "showStatusBar") { Device.BeginInvokeOnMainThread(() => UIApplication.SharedApplication.SetStatusBarHidden(!(bool)message.Data, false)); } else if (message.Command == "syncCompleted") { if (message.Data is Dictionary <string, object> data && data.ContainsKey("successfully")) { var success = data["successfully"] as bool?; if (success.GetValueOrDefault()) { } } }
public GroupingsPage(bool mainPage, CipherType?type = null, string folderId = null, string collectionId = null, string pageTitle = null, string vaultFilterSelection = null, PreviousPageInfo previousPage = null, bool deleted = false) { _pageName = string.Concat(nameof(GroupingsPage), "_", DateTime.UtcNow.Ticks); InitializeComponent(); SetActivityIndicator(_mainContent); _broadcasterService = ServiceContainer.Resolve <IBroadcasterService>("broadcasterService"); _syncService = ServiceContainer.Resolve <ISyncService>("syncService"); _pushNotificationService = ServiceContainer.Resolve <IPushNotificationService>("pushNotificationService"); _stateService = ServiceContainer.Resolve <IStateService>("stateService"); _vaultTimeoutService = ServiceContainer.Resolve <IVaultTimeoutService>("vaultTimeoutService"); _cipherService = ServiceContainer.Resolve <ICipherService>("cipherService"); _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _vm = BindingContext as GroupingsPageViewModel; _vm.Page = this; _vm.MainPage = mainPage; _vm.Type = type; _vm.FolderId = folderId; _vm.CollectionId = collectionId; _vm.Deleted = deleted; _previousPage = previousPage; if (pageTitle != null) { _vm.PageTitle = pageTitle; } if (vaultFilterSelection != null) { _vm.VaultFilterDescription = vaultFilterSelection; } if (Device.RuntimePlatform == Device.iOS) { _absLayout.Children.Remove(_fab); ToolbarItems.Add(_addItem); } else { ToolbarItems.Add(_syncItem); ToolbarItems.Add(_lockItem); ToolbarItems.Add(_exitItem); } if (deleted) { _absLayout.Children.Remove(_fab); ToolbarItems.Remove(_addItem); } if (!mainPage) { ToolbarItems.Remove(_accountAvatar); } }
protected BaseChangePasswordViewModel() { _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService"); _stateService = ServiceContainer.Resolve <IStateService>("stateService"); _policyService = ServiceContainer.Resolve <IPolicyService>("policyService"); _passwordGenerationService = ServiceContainer.Resolve <IPasswordGenerationService>("passwordGenerationService"); _i18nService = ServiceContainer.Resolve <II18nService>("i18nService"); _cryptoService = ServiceContainer.Resolve <ICryptoService>("cryptoService"); _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _apiService = ServiceContainer.Resolve <IApiService>("apiService"); _syncService = ServiceContainer.Resolve <ISyncService>("syncService"); }
public ExtendedContentPage(bool syncIndicator = false, bool updateActivity = true, bool requireAuth = true) { _syncIndicator = syncIndicator; _updateActivity = updateActivity; _requireAuth = requireAuth; _syncService = Resolver.Resolve <ISyncService>(); _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>(); _lockService = Resolver.Resolve <ILockService>(); _deviceActionService = Resolver.Resolve <IDeviceActionService>(); _authService = Resolver.Resolve <IAuthService>(); BackgroundColor = Color.FromHex("efeff4"); }
public LockPageViewModel() { _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService"); _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _lockService = ServiceContainer.Resolve <ILockService>("lockService"); _cryptoService = ServiceContainer.Resolve <ICryptoService>("cryptoService"); _storageService = ServiceContainer.Resolve <IStorageService>("storageService"); _userService = ServiceContainer.Resolve <IUserService>("userService"); _messagingService = ServiceContainer.Resolve <IMessagingService>("messagingService"); PageTitle = AppResources.VerifyMasterPassword; TogglePasswordCommand = new Command(TogglePassword); }
public LoginPage(string email = null) : base(updateActivity: false) { _email = email; _authService = Resolver.Resolve <IAuthService>(); _syncService = Resolver.Resolve <ISyncService>(); _deviceActionService = Resolver.Resolve <IDeviceActionService>(); _settings = Resolver.Resolve <ISettings>(); _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>(); _pushNotification = Resolver.Resolve <IPushNotificationService>(); Init(); }
// TODO: Model binding context? public SettingsPage() { _authService = Resolver.Resolve <IAuthService>(); _settings = Resolver.Resolve <ISettings>(); _fingerprint = Resolver.Resolve <IFingerprint>(); _pushNotification = Resolver.Resolve <IPushNotificationService>(); _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>(); _deviceActionService = Resolver.Resolve <IDeviceActionService>(); _deviceInfoService = Resolver.Resolve <IDeviceInfoService>(); _lockService = Resolver.Resolve <ILockService>(); Init(); }
public VerificationCodeViewModel() { _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService"); _userVerificationService = ServiceContainer.Resolve <IUserVerificationService>("userVerificationService"); _apiService = ServiceContainer.Resolve <IApiService>("apiService"); _verificationActionsFlowHelper = ServiceContainer.Resolve <IVerificationActionsFlowHelper>("verificationActionsFlowHelper"); PageTitle = AppResources.VerificationCode; TogglePasswordCommand = new Command(TogglePassword); MainActionCommand = new AsyncCommand(MainActionAsync, allowsMultipleExecutions: false); RequestOTPCommand = new AsyncCommand(RequestOTPAsync, allowsMultipleExecutions: false); }
public VaultAttachmentsPage(string loginId) : base(true) { _loginId = loginId; _loginService = Resolver.Resolve <ILoginService>(); _connectivity = Resolver.Resolve <IConnectivity>(); _userDialogs = Resolver.Resolve <IUserDialogs>(); _deviceActiveService = Resolver.Resolve <IDeviceActionService>(); _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>(); _tokenService = Resolver.Resolve <ITokenService>(); _cryptoService = Resolver.Resolve <ICryptoService>(); Init(); }
public TwoFactorPageViewModel() { _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _authService = ServiceContainer.Resolve <IAuthService>("authService"); _syncService = ServiceContainer.Resolve <ISyncService>("syncService"); _storageService = ServiceContainer.Resolve <IStorageService>("storageService"); _apiService = ServiceContainer.Resolve <IApiService>("apiService"); _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService"); _environmentService = ServiceContainer.Resolve <IEnvironmentService>("environmentService"); _messagingService = ServiceContainer.Resolve <IMessagingService>("messagingService"); _broadcasterService = ServiceContainer.Resolve <IBroadcasterService>("broadcasterService"); PageTitle = AppResources.TwoStepLogin; }
public DeviceActionController( ApiSettings settings, ILogger <DeviceActionController> logger, ITransactionCoordinator transactionCoordinator, IDeviceActionService deviceActionService, IApiDeviceActionServerModelMapper deviceActionModelMapper ) : base(settings, logger, transactionCoordinator) { this.DeviceActionService = deviceActionService; this.DeviceActionModelMapper = deviceActionModelMapper; this.BulkInsertLimit = 250; this.MaxLimit = 1000; this.DefaultLimit = 250; }
public SettingsPageViewModel() { _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService"); _cryptoService = ServiceContainer.Resolve <ICryptoService>("cryptoService"); _userService = ServiceContainer.Resolve <IUserService>("userService"); _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _environmentService = ServiceContainer.Resolve <IEnvironmentService>("environmentService"); _messagingService = ServiceContainer.Resolve <IMessagingService>("messagingService"); _lockService = ServiceContainer.Resolve <ILockService>("lockService"); _storageService = ServiceContainer.Resolve <IStorageService>("storageService"); _syncService = ServiceContainer.Resolve <ISyncService>("syncService"); GroupedItems = new ExtendedObservableCollection <SettingsPageListGroup>(); PageTitle = AppResources.Settings; }
public LoginSsoPageViewModel() { _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _authService = ServiceContainer.Resolve <IAuthService>("authService"); _syncService = ServiceContainer.Resolve <ISyncService>("syncService"); _apiService = ServiceContainer.Resolve <IApiService>("apiService"); _passwordGenerationService = ServiceContainer.Resolve <IPasswordGenerationService>("passwordGenerationService"); _cryptoFunctionService = ServiceContainer.Resolve <ICryptoFunctionService>("cryptoFunctionService"); _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService"); _stateService = ServiceContainer.Resolve <IStateService>("stateService"); PageTitle = AppResources.Bitwarden; LogInCommand = new Command(async() => await LogInAsync()); }
public static async Task <bool> PerformUpdateTasksAsync(ISyncService syncService, IDeviceActionService deviceActionService, IStateService stateService) { var currentBuild = deviceActionService.GetBuildNumber(); var lastBuild = await stateService.GetLastBuildAsync(); if (lastBuild == null || lastBuild != currentBuild) { // Updated var tasks = Task.Run(() => syncService.FullSyncAsync(true)); await stateService.SetLastBuildAsync(currentBuild); return(true); } return(false); }
public TwoFactorPageViewModel() { _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _authService = ServiceContainer.Resolve <IAuthService>("authService"); _syncService = ServiceContainer.Resolve <ISyncService>("syncService"); _apiService = ServiceContainer.Resolve <IApiService>("apiService"); _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService"); _environmentService = ServiceContainer.Resolve <IEnvironmentService>("environmentService"); _messagingService = ServiceContainer.Resolve <IMessagingService>("messagingService"); _broadcasterService = ServiceContainer.Resolve <IBroadcasterService>("broadcasterService"); _stateService = ServiceContainer.Resolve <IStateService>("stateService"); _i18nService = ServiceContainer.Resolve <II18nService>("i18nService"); _appIdService = ServiceContainer.Resolve <IAppIdService>("appIdService"); PageTitle = AppResources.TwoStepLogin; SubmitCommand = new Command(async() => await SubmitAsync()); }
public LockPageViewModel() { _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService"); _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _lockService = ServiceContainer.Resolve <ILockService>("lockService"); _cryptoService = ServiceContainer.Resolve <ICryptoService>("cryptoService"); _storageService = ServiceContainer.Resolve <IStorageService>("storageService"); _userService = ServiceContainer.Resolve <IUserService>("userService"); _messagingService = ServiceContainer.Resolve <IMessagingService>("messagingService"); _secureStorageService = ServiceContainer.Resolve <IStorageService>("secureStorageService"); _environmentService = ServiceContainer.Resolve <IEnvironmentService>("environmentService"); _stateService = ServiceContainer.Resolve <IStateService>("stateService"); PageTitle = AppResources.VerifyMasterPassword; TogglePasswordCommand = new Command(TogglePassword); SubmitCommand = new Command(async() => await SubmitAsync()); }
public SetPasswordPageViewModel() { _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService"); _apiService = ServiceContainer.Resolve <IApiService>("apiService"); _cryptoService = ServiceContainer.Resolve <ICryptoService>("cryptoService"); _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService"); _stateService = ServiceContainer.Resolve <IStateService>("stateService"); _policyService = ServiceContainer.Resolve <IPolicyService>("policyService"); _passwordGenerationService = ServiceContainer.Resolve <IPasswordGenerationService>("passwordGenerationService"); _i18nService = ServiceContainer.Resolve <II18nService>("i18nService"); PageTitle = AppResources.SetMasterPassword; TogglePasswordCommand = new Command(TogglePassword); ToggleConfirmPasswordCommand = new Command(ToggleConfirmPassword); SubmitCommand = new Command(async() => await SubmitAsync()); }