Upgrade electron (and lots of other packages) to fix letsencrypt

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