Upgrade electron (and lots of other packages) to fix letsencrypt
This commit is contained in:
@@ -74,8 +74,8 @@ export class AppService {
|
|||||||
this.semver = (<any>window).require('semver');
|
this.semver = (<any>window).require('semver');
|
||||||
this.crypto = (<any>window).require('crypto');
|
this.crypto = (<any>window).require('crypto');
|
||||||
this.electron = (<any>window).require('electron');
|
this.electron = (<any>window).require('electron');
|
||||||
this.remote = this.electron.remote;
|
this.remote = (<any>window).require('@electron/remote');
|
||||||
this.nativeApp = this.electron.remote.app;
|
this.nativeApp = this.remote.app;
|
||||||
this.appData = this.path.join(this.nativeApp.getPath('appData'), 'SideQuest');
|
this.appData = this.path.join(this.nativeApp.getPath('appData'), 'SideQuest');
|
||||||
this.exec = (<any>window).require('child_process').exec;
|
this.exec = (<any>window).require('child_process').exec;
|
||||||
this.execSync = (<any>window).require('child_process').execSync;
|
this.execSync = (<any>window).require('child_process').execSync;
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ export class FilesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
async uploadFiles() {
|
async uploadFiles() {
|
||||||
let res = await this.appService.electron.remote.dialog.showOpenDialog({
|
let res = await this.appService.remote.dialog.showOpenDialog({
|
||||||
properties: ['openFile', 'multiSelections'],
|
properties: ['openFile', 'multiSelections'],
|
||||||
defaultPath: this.adbService.savePath,
|
defaultPath: this.adbService.savePath,
|
||||||
});
|
});
|
||||||
@@ -281,7 +281,7 @@ export class FilesComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
async pickLocation() {
|
async pickLocation() {
|
||||||
let res = await this.appService.electron.remote.dialog.showOpenDialog({
|
let res = await this.appService.remote.dialog.showOpenDialog({
|
||||||
properties: ['openDirectory'],
|
properties: ['openDirectory'],
|
||||||
defaultPath: this.adbService.savePath,
|
defaultPath: this.adbService.savePath,
|
||||||
});
|
});
|
||||||
@@ -338,7 +338,7 @@ export class FilesComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
openSaveLocation() {
|
openSaveLocation() {
|
||||||
this.appService.electron.remote.shell.openItem(this.adbService.savePath);
|
this.appService.remote.shell.openItem(this.adbService.savePath);
|
||||||
}
|
}
|
||||||
async readdir(path: string) {
|
async readdir(path: string) {
|
||||||
let dirContents: FileFolderListing[];
|
let dirContents: FileFolderListing[];
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ export class HeaderComponent implements OnInit {
|
|||||||
this.saveLogcatPath = null;
|
this.saveLogcatPath = null;
|
||||||
}
|
}
|
||||||
async selectLogcatOutput() {
|
async selectLogcatOutput() {
|
||||||
const res = await this.appService.electron.remote.dialog.showOpenDialog({
|
const res = await this.appService.remote.dialog.showOpenDialog({
|
||||||
properties: ['openDirectory'],
|
properties: ['openDirectory'],
|
||||||
defaultPath: this.adbService.savePath,
|
defaultPath: this.adbService.savePath,
|
||||||
});
|
});
|
||||||
@@ -317,7 +317,7 @@ export class HeaderComponent implements OnInit {
|
|||||||
this.appService.remote.getCurrentWindow().toggleDevTools();
|
this.appService.remote.getCurrentWindow().toggleDevTools();
|
||||||
}
|
}
|
||||||
async selectAppToInstall() {
|
async selectAppToInstall() {
|
||||||
let files = await this.appService.electron.remote.dialog.showOpenDialog({
|
let files = await this.appService.remote.dialog.showOpenDialog({
|
||||||
properties: ['openFile', 'multiSelections'],
|
properties: ['openFile', 'multiSelections'],
|
||||||
defaultPath: this.adbService.savePath,
|
defaultPath: this.adbService.savePath,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export class PackagesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async pickBackupLocation() {
|
async pickBackupLocation() {
|
||||||
const res = await this.appService.electron.remote.dialog.showOpenDialog({
|
const res = await this.appService.remote.dialog.showOpenDialog({
|
||||||
properties: ['openDirectory'],
|
properties: ['openDirectory'],
|
||||||
defaultPath: this.appService.backupPath,
|
defaultPath: this.appService.backupPath,
|
||||||
});
|
});
|
||||||
|
|||||||
+11
-22
@@ -457,7 +457,7 @@ function parseOpenUrl(argv: string[]) {
|
|||||||
function createWindow() {
|
function createWindow() {
|
||||||
appWindow = new AppWindow(config);
|
appWindow = new AppWindow(config);
|
||||||
mainWindow = appWindow.window;
|
mainWindow = appWindow.window;
|
||||||
|
require('@electron/remote/main').enable(mainWindow.webContents);
|
||||||
if (process.env.NODE_ENV === 'dev') {
|
if (process.env.NODE_ENV === 'dev') {
|
||||||
mainWindow.loadURL('http://localhost:4205');
|
mainWindow.loadURL('http://localhost:4205');
|
||||||
mainWindow.webContents.openDevTools();
|
mainWindow.webContents.openDevTools();
|
||||||
@@ -475,28 +475,16 @@ function createWindow() {
|
|||||||
if (process.platform !== 'linux') autoUpdater.checkForUpdates();
|
if (process.platform !== 'linux') autoUpdater.checkForUpdates();
|
||||||
});
|
});
|
||||||
|
|
||||||
protocol.registerBufferProtocol(
|
protocol.registerBufferProtocol('beatsaver', (request, _callback) => {
|
||||||
'beatsaver',
|
mainWindow.webContents.send(
|
||||||
(request, _callback) => {
|
'open-url',
|
||||||
mainWindow.webContents.send(
|
'sidequest://bsaber/#https://beatsaver.com/api/download/key/' + request.url.replace('beatsaver://', '')
|
||||||
'open-url',
|
);
|
||||||
'sidequest://bsaber/#https://beatsaver.com/api/download/key/' + request.url.replace('beatsaver://', '')
|
});
|
||||||
);
|
|
||||||
},
|
|
||||||
error => {
|
|
||||||
if (error) console.error('Failed to register protocol');
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
protocol.registerStringProtocol(
|
protocol.registerStringProtocol('sidequest', (request, _callback) => {
|
||||||
'sidequest',
|
mainWindow.webContents.send('open-url', request.url);
|
||||||
(request, _callback) => {
|
});
|
||||||
mainWindow.webContents.send('open-url', request.url);
|
|
||||||
},
|
|
||||||
error => {
|
|
||||||
if (error) console.error('Failed to register protocol');
|
|
||||||
}
|
|
||||||
);
|
|
||||||
mainWindow.webContents.on('did-fail-load', () => mainWindow.loadURL(mainWindow.webContents.getURL()));
|
mainWindow.webContents.on('did-fail-load', () => mainWindow.loadURL(mainWindow.webContents.getURL()));
|
||||||
mainWindow.webContents.session.on('will-download', (_evt, item, _webContents) => {
|
mainWindow.webContents.session.on('will-download', (_evt, item, _webContents) => {
|
||||||
let url = item.getURL();
|
let url = item.getURL();
|
||||||
@@ -598,6 +586,7 @@ function setupMenu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setupApp() {
|
function setupApp() {
|
||||||
|
require('@electron/remote/main').initialize();
|
||||||
app.on('second-instance', (_event, commandLine, _workingDirectory) => {
|
app.on('second-instance', (_event, commandLine, _workingDirectory) => {
|
||||||
parseOpenUrl(commandLine);
|
parseOpenUrl(commandLine);
|
||||||
if (mainWindow) {
|
if (mainWindow) {
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ export class AppWindow {
|
|||||||
webPreferences: {
|
webPreferences: {
|
||||||
webviewTag: true,
|
webviewTag: true,
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
|
contextIsolation: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
this._window = new BrowserWindow(options);
|
this._window = new BrowserWindow(options);
|
||||||
|
|||||||
+3
-2
@@ -23,7 +23,6 @@
|
|||||||
"electron-dev:test": "yarn platform-tools && cross-env NODE_ENV=dev SQ_ENV_CFG=test electron .",
|
"electron-dev:test": "yarn platform-tools && cross-env NODE_ENV=dev SQ_ENV_CFG=test electron .",
|
||||||
"electron-dev:test2": "yarn platform-tools && cross-env NODE_ENV=dev SQ_ENV_CFG=test2 electron .",
|
"electron-dev:test2": "yarn platform-tools && cross-env NODE_ENV=dev SQ_ENV_CFG=test2 electron .",
|
||||||
"electron-dev:local": "yarn platform-tools && cross-env NODE_ENV=dev SQ_ENV_CFG=local electron .",
|
"electron-dev:local": "yarn platform-tools && cross-env NODE_ENV=dev SQ_ENV_CFG=local electron .",
|
||||||
|
|
||||||
"electron": "yarn electron-build && yarn electron-dev",
|
"electron": "yarn electron-build && yarn electron-dev",
|
||||||
"app-build": "cd desktop-app && ng build --prod --aot && cd ..",
|
"app-build": "cd desktop-app && ng build --prod --aot && cd ..",
|
||||||
"platform-tools": "node build-electron/platform-tools.js",
|
"platform-tools": "node build-electron/platform-tools.js",
|
||||||
@@ -88,6 +87,8 @@
|
|||||||
"trailingComma": "es5"
|
"trailingComma": "es5"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@electron/remote": "^2.0.1",
|
||||||
|
"@types/electron": "^1.6.10",
|
||||||
"adbkit": "^2.11.1",
|
"adbkit": "^2.11.1",
|
||||||
"adm-zip": "^0.4.14",
|
"adm-zip": "^0.4.14",
|
||||||
"bytenode": "^1.1.6",
|
"bytenode": "^1.1.6",
|
||||||
@@ -111,7 +112,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/cli": "^8.0.3",
|
"@angular/cli": "^8.0.3",
|
||||||
"electron": "7.2.4",
|
"electron": "13.5.1",
|
||||||
"electron-builder": "^22.4.0",
|
"electron-builder": "^22.4.0",
|
||||||
"electron-notarize": "^0.1.1",
|
"electron-notarize": "^0.1.1",
|
||||||
"husky": "^2.3.0",
|
"husky": "^2.3.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user