patching electron

This commit is contained in:
antelle 2021-02-06 14:46:24 +01:00
parent d3f79af2ab
commit 5af7837468
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
6 changed files with 42 additions and 0 deletions

View File

@ -457,6 +457,14 @@ module.exports = function (grunt) {
}
}
},
'electron-patch': {
'win32-x64': 'tmp/desktop/KeeWeb-win32-x64/KeeWeb.exe',
'win32-ia32': 'tmp/desktop/KeeWeb-win32-ia32/KeeWeb.exe',
'win32-arm64': 'tmp/desktop/KeeWeb-win32-arm64/KeeWeb.exe',
'darwin-x64': 'tmp/desktop/KeeWeb-darwin-x64/KeeWeb.app',
'darwin-arm64': 'tmp/desktop/KeeWeb-darwin-arm64/KeeWeb.app',
'linux': 'tmp/desktop/KeeWeb-linux-x64/keeweb'
},
osacompile: {
options: {
language: 'JavaScript'

View File

@ -0,0 +1,12 @@
module.exports = function (grunt) {
grunt.registerMultiTask('electron-patch', 'Patches Electron executable', async function () {
const patch = require('electron-evil-feature-patcher');
for (const { src } of this.files) {
for (const path of src) {
grunt.log.writeln(`Patching ${path}...`);
patch({ path });
}
}
});
};

View File

@ -51,6 +51,7 @@ module.exports = function(grunt) {
'default',
'build-desktop-app-content',
'electron:darwin-x64',
'electron-patch:darwin-x64',
'build-darwin-installer',
'copy:desktop-darwin-helper-x64',
'copy:desktop-darwin-installer-helper-x64',

View File

@ -26,6 +26,7 @@ module.exports = function (grunt) {
grunt.registerTask('build-desktop-executables-linux', [
'electron:linux',
'electron-patch:linux',
'chmod:linux-desktop-x64',
'copy:native-modules-linux-x64'
]);
@ -33,6 +34,8 @@ module.exports = function (grunt) {
grunt.registerTask('build-desktop-executables-darwin', [
'electron:darwin-x64',
'electron:darwin-arm64',
'electron-patch:darwin-x64',
'electron-patch:darwin-arm64',
'build-darwin-installer',
'copy:desktop-darwin-helper-x64',
'copy:desktop-darwin-helper-arm64',
@ -56,6 +59,9 @@ module.exports = function (grunt) {
'electron:win32-x64',
'electron:win32-ia32',
'electron:win32-arm64',
'electron-patch:win32-x64',
'electron-patch:win32-ia32',
'electron-patch:win32-arm64',
sign ? 'sign-exe:win32-build-x64' : 'noop',
sign ? 'sign-exe:win32-build-ia32' : 'noop',
sign ? 'sign-exe:win32-build-arm64' : 'noop',

14
package-lock.json generated
View File

@ -31,6 +31,7 @@
"dompurify": "^2.2.6",
"electron": "^12.0.0-beta.22",
"electron-builder": "^22.9.1",
"electron-evil-feature-patcher": "^1.2.0",
"electron-notarize": "^1.0.0",
"electron-osx-sign": "^0.5.0",
"eslint": "^7.19.0",
@ -5529,6 +5530,14 @@
"node": ">=8"
}
},
"node_modules/electron-evil-feature-patcher": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/electron-evil-feature-patcher/-/electron-evil-feature-patcher-1.2.0.tgz",
"integrity": "sha512-R6TZ2JWUFuCsgMl7W1sRaWgNbipS56d4waFHKq0/CnI1C6yrjJHdxB94QUmfDTlhvEXPy7e1bio0AZ7AQH9p2A==",
"bin": {
"electron-evil-feature-patcher": "cli.js"
}
},
"node_modules/electron-notarize": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-1.0.0.tgz",
@ -25540,6 +25549,11 @@
}
}
},
"electron-evil-feature-patcher": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/electron-evil-feature-patcher/-/electron-evil-feature-patcher-1.2.0.tgz",
"integrity": "sha512-R6TZ2JWUFuCsgMl7W1sRaWgNbipS56d4waFHKq0/CnI1C6yrjJHdxB94QUmfDTlhvEXPy7e1bio0AZ7AQH9p2A=="
},
"electron-notarize": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-1.0.0.tgz",

View File

@ -33,6 +33,7 @@
"dompurify": "^2.2.6",
"electron": "^12.0.0-beta.22",
"electron-builder": "^22.9.1",
"electron-evil-feature-patcher": "^1.2.0",
"electron-notarize": "^1.0.0",
"electron-osx-sign": "^0.5.0",
"eslint": "^7.19.0",