Skip to content

Commit fedb593

Browse files
authored
chore: Update electron-builder v26.0.3 (#3047)
* updated electron-builder v26.0.3 * add flipFuses
1 parent 641e69b commit fedb593

File tree

4 files changed

+185
-105
lines changed

4 files changed

+185
-105
lines changed

build/afterPack.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
const { flipFuses, FuseVersion, FuseV1Options } = require('@electron/fuses');
2+
3+
exports.default = async function afterPack(context) {
4+
console.log(
5+
'AfterPack: Platform =',
6+
context.electronPlatformName,
7+
'OutDir =',
8+
context.appOutDir
9+
);
10+
11+
// Skip fuses for MAS builds - they are incompatible
12+
if (
13+
context.electronPlatformName === 'mas' ||
14+
context.appOutDir.includes('mas-universal')
15+
) {
16+
console.log(
17+
'Skipping fuses for MAS build (App Store has its own integrity validation)'
18+
);
19+
return;
20+
}
21+
22+
// Apply security fuses for regular builds
23+
console.log('Applying electron fuses for enhanced security');
24+
25+
const appPath =
26+
context.electronPlatformName === 'darwin'
27+
? `${context.appOutDir}/Rocket.Chat.app`
28+
: context.appOutDir;
29+
30+
await flipFuses(appPath, {
31+
version: FuseVersion.V1,
32+
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
33+
[FuseV1Options.OnlyLoadAppFromAsar]: true,
34+
[FuseV1Options.RunAsNode]: true,
35+
[FuseV1Options.EnableCookieEncryption]: false,
36+
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: true,
37+
[FuseV1Options.EnableNodeCliInspectArguments]: true,
38+
[FuseV1Options.LoadBrowserProcessSpecificV8Snapshot]: false,
39+
[FuseV1Options.GrantFileProtocolExtraPrivileges]: true,
40+
});
41+
42+
console.log('Electron fuses applied successfully');
43+
};

electron-builder.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"name": "Rocket.Chat",
77
"schemes": ["rocketchat"]
88
},
9+
"afterPack": "./build/afterPack.js",
910
"mac": {
1011
"category": "public.app-category.productivity",
1112
"target": ["dmg", "pkg", "zip", "mas"],
@@ -70,12 +71,10 @@
7071
}
7172
],
7273
"icon": "build/icon.ico",
73-
"publisherName": "Rocket.Chat Technologies Corp.",
7474
"legalTrademarks": "",
7575
"verifyUpdateCodeSignature": true,
7676
"requestedExecutionLevel": "asInvoker",
7777
"signAndEditExecutable": true,
78-
"signDlls": false,
7978
"artifactName": "rocketchat-${version}-${os}-${arch}.${ext}"
8079
},
8180
"nsis": {
@@ -113,15 +112,11 @@
113112
"executableName": "rocketchat-desktop",
114113
"category": "GNOME;GTK;Network;InstantMessaging",
115114
"desktop": {
116-
"StartupWMClass": "Rocket.Chat",
117-
"MimeType": "x-scheme-handler/rocketchat",
118115
"entry": {
119116
"Name": "Rocket.Chat",
120117
"Comment": "Official Rocket.Chat Desktop Client",
121118
"GenericName": "Rocket.Chat",
122-
"Categories": "GNOME;GTK;Network;InstantMessaging",
123-
"StartupWMClass": "Rocket.Chat",
124-
"MimeType": "x-scheme-handler/rocketchat"
119+
"Categories": "GNOME;GTK;Network;InstantMessaging"
125120
}
126121
},
127122
"artifactName": "rocketchat-${version}-${os}-${arch}.${ext}"

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"build": "rollup -c",
3434
"build:watch": "rollup -c -w",
3535
"build-mac": "yarn build && yarn electron-builder --publish never --mac --universal",
36+
"build-mas": "yarn build && yarn electron-builder --publish never --mac mas --universal",
3637
"build-win": "yarn build && yarn electron-builder --publish never --win",
3738
"build-linux": "yarn build && yarn electron-builder --publish never --linux",
3839
"build-assets": "ts-node -O '{\"module\":\"commonjs\"}' src/buildAssets.ts",
@@ -88,6 +89,7 @@
8889
"@babel/preset-env": "~7.23.7",
8990
"@babel/preset-react": "~7.23.3",
9091
"@babel/preset-typescript": "~7.23.3",
92+
"@electron/fuses": "~1.8.0",
9193
"@fiahfy/icns-convert": "~0.0.12",
9294
"@fiahfy/ico-convert": "~0.0.12",
9395
"@kayahr/jest-electron-runner": "29.14.0",
@@ -111,7 +113,7 @@
111113
"conventional-changelog-cli": "~4.1.0",
112114
"convert-svg-to-png": "~0.6.4",
113115
"electron": "~34.0.2",
114-
"electron-builder": "25.1.8",
116+
"electron-builder": "26.0.3",
115117
"electron-devtools-installer": "^3.2.0",
116118
"electron-notarize": "^1.2.2",
117119
"eslint": "~8.56.0",

0 commit comments

Comments
 (0)