mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
pack main and renderer
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
//import { remote } from 'electron';
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
|
||||
import { DesktopMessagingService } from './desktopMessaging.service';
|
||||
import { DesktopPlatformUtilsService } from './desktopPlatformUtils.service';
|
||||
import { DesktopStorageService } from './desktopStorage.service';
|
||||
import { DesktopSecureStorageService } from './desktopSecureStorage.service';
|
||||
import { DesktopMessagingService } from '../../services/desktopMessaging.service';
|
||||
import { DesktopPlatformUtilsService } from '../../services/desktopPlatformUtils.service';
|
||||
import { DesktopStorageService } from '../../services/desktopStorage.service';
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
@@ -52,7 +53,7 @@ const utilsService = new UtilsService();
|
||||
const platformUtilsService = new DesktopPlatformUtilsService();
|
||||
const messagingService = new DesktopMessagingService();
|
||||
const storageService: StorageServiceAbstraction = new DesktopStorageService();
|
||||
//const secureStorageService: StorageServiceAbstraction = new DesktopSecureStorageService();
|
||||
const secureStorageService: StorageServiceAbstraction = storageService; //remote.getGlobal('secureStorageService');
|
||||
const constantsService = new ConstantsService({}, 0);
|
||||
const cryptoService = new CryptoService(storageService, storageService);
|
||||
const tokenService = new TokenService(storageService);
|
||||
|
||||
@@ -2,6 +2,10 @@ import { app, BrowserWindow, screen } from 'electron';
|
||||
import * as path from 'path';
|
||||
import * as url from 'url';
|
||||
|
||||
//import { DesktopSecureStorageService } from './services/desktopSecureStorage.service';
|
||||
//const secureStorageService = new DesktopSecureStorageService();
|
||||
//(global as any).secureStorageService = secureStorageService;
|
||||
|
||||
let win: BrowserWindow;
|
||||
const args = process.argv.slice(1);
|
||||
const watch = args.some((val) => val === '--watch');
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import {
|
||||
MessagingService,
|
||||
PlatformUtilsService,
|
||||
} from 'jslib/abstractions';
|
||||
|
||||
@Injectable()
|
||||
export class DesktopMessagingService implements MessagingService {
|
||||
send(subscriber: string, arg: any = {}) {
|
||||
const message = Object.assign({}, { command: subscriber }, arg);
|
||||
@@ -1,5 +1,3 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { DeviceType } from 'jslib/enums';
|
||||
|
||||
import { PlatformUtilsService } from 'jslib/abstractions';
|
||||
@@ -10,7 +8,6 @@ const AnalyticsIds = {
|
||||
[DeviceType.MacOs]: 'UA-81915606-18',
|
||||
};
|
||||
|
||||
@Injectable()
|
||||
export class DesktopPlatformUtilsService implements PlatformUtilsService {
|
||||
private deviceCache: DeviceType = null;
|
||||
private analyticsIdCache: string = null;
|
||||
@@ -1,9 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { getPassword, setPassword, deletePassword } from 'keytar';
|
||||
|
||||
import { StorageService } from 'jslib/abstractions';
|
||||
|
||||
@Injectable()
|
||||
export class DesktopSecureStorageService implements StorageService {
|
||||
async get<T>(key: string): Promise<T> {
|
||||
const val: string = await getPassword('bitwarden', key);
|
||||
@@ -1,11 +1,8 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { StorageService } from 'jslib/abstractions';
|
||||
|
||||
const Store = require('electron-store');
|
||||
const store = new Store();
|
||||
|
||||
@Injectable()
|
||||
export class DesktopStorageService implements StorageService {
|
||||
get<T>(key: string): Promise<T> {
|
||||
const val = store.get(key) as T;
|
||||
Reference in New Issue
Block a user