diff --git a/packages/desktop-electron/index.ts b/packages/desktop-electron/index.ts index c71a021267c..bb75cbf6916 100644 --- a/packages/desktop-electron/index.ts +++ b/packages/desktop-electron/index.ts @@ -24,8 +24,6 @@ import { listen as listenToWindowState, } from './window-state'; -import './setRequireHook'; - import './security'; Module.globalPaths.push(__dirname + '/..'); diff --git a/packages/desktop-electron/server.ts b/packages/desktop-electron/server.ts index 4ca016ca99a..a49e14d4095 100644 --- a/packages/desktop-electron/server.ts +++ b/packages/desktop-electron/server.ts @@ -3,8 +3,6 @@ import Module from 'module'; // @ts-strict-ignore import fetch from 'node-fetch'; -import './setRequireHook'; - Module.globalPaths.push(__dirname + '/..'); global.fetch = fetch; diff --git a/packages/desktop-electron/setRequireHook.js b/packages/desktop-electron/setRequireHook.js deleted file mode 100644 index ad66c6b9e53..00000000000 --- a/packages/desktop-electron/setRequireHook.js +++ /dev/null @@ -1,3 +0,0 @@ -require.extensions['.electron.js'] = function (module, filename) { - return require.extensions['.js'](module, filename); -}; diff --git a/packages/desktop-electron/signWindowsHook.js b/packages/desktop-electron/signWindowsHook.js deleted file mode 100644 index dff7ebff1a3..00000000000 --- a/packages/desktop-electron/signWindowsHook.js +++ /dev/null @@ -1,58 +0,0 @@ -const { execSync } = require('child_process'); - -const { - SIGN_TOOL_PATH = 'C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64\\signtool.exe', - TIMESTAMP_SERVER = 'http://timestamp.digicert.com', -} = process.env; - -const SITE = 'https://actualbudget.com/'; - -const importPfx = (certPath, password) => { - /* eslint-disable rulesdir/typography */ - const command = [ - ['certutil'], - ['-f'], - ['-p', `"${password}"`], - ['-importPfx', 'My', `"${certPath}"`, 'NoRoot'], - ] - .map(sub => sub.join(' ')) - .join(' '); - /* eslint-enable rulesdir/typography */ - - try { - execSync(command, { stdio: 'inherit' }); - } catch { - console.error('Unable to import certificate'); - } -}; - -const signBinary = (path, name) => { - /* eslint-disable rulesdir/typography */ - const command = [ - [`"${SIGN_TOOL_PATH}"`], - ['sign'], - ['/a'], - ['/s', 'My'], - ['/sm'], - ['/t', `"${TIMESTAMP_SERVER}"`], - ['/d', `"${name}"`], - ['/du', `"${SITE}"`], - [`"${path}"`], - ] - .map(sub => sub.join(' ')) - .join(' '); - /* eslint-enable rulesdir/typography */ - - try { - execSync(command, { stdio: 'inherit' }); - } catch { - console.error(`Signing ${path} failed`); - } -}; - -exports.default = ({ path, name, cscInfo: { file, password } = {} }) => { - if (!file) return; - - importPfx(file, password); - signBinary(path, name, file); -}; diff --git a/upcoming-release-notes/3014.md b/upcoming-release-notes/3014.md new file mode 100644 index 00000000000..7a57363130c --- /dev/null +++ b/upcoming-release-notes/3014.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [MikesGlitch] +--- + +Remove unused files from Electron app