Skip to content

Commit e7a885a

Browse files
kanishk98akashnimare
authored andcommitted
macos: Enable notarization for macOS Catalina.
This fixes the issue for Catalina users.
1 parent 17d4d97 commit e7a885a

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

build/entitlements.mac.plist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
6+
<true/>
7+
</dict>
8+
</plist>

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"test"
4444
],
4545
"build": {
46+
"afterSign": "./scripts/notarize.js",
4647
"appId": "org.zulip.zulip-electron",
4748
"asar": true,
4849
"asarUnpack": [
@@ -57,7 +58,11 @@
5758
"mac": {
5859
"category": "public.app-category.productivity",
5960
"darkModeSupport": true,
60-
"artifactName": "${productName}-${version}-${arch}.${ext}"
61+
"artifactName": "${productName}-${version}-${arch}.${ext}",
62+
"hardenedRuntime": true,
63+
"entitlements": "build/entitlements.mac.plist",
64+
"entitlementsInherit": "build/entitlements.mac.plist",
65+
"gatekeeperAssess": false
6166
},
6267
"linux": {
6368
"category": "Chat;GNOME;GTK;Network;InstantMessaging",
@@ -148,9 +153,10 @@
148153
"cp-file": "5.0.0",
149154
"devtron": "1.4.0",
150155
"electron": "3.1.10",
151-
"electron-builder": "20.40.2",
156+
"electron-builder": "20.43.0",
152157
"electron-connect": "0.6.2",
153158
"electron-debug": "1.4.0",
159+
"electron-notarize": "0.2.0",
154160
"eslint-config-xo-typescript": "0.14.0",
155161
"fs-extra": "8.1.0",
156162
"gulp": "4.0.0",

scripts/notarize.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const path = require('path');
2+
const dotenv = require('dotenv');
3+
4+
dotenv.config({ path: path.join(__dirname, '/../.env') });
5+
6+
const { notarize } = require('electron-notarize');
7+
8+
exports.default = async function notarizing(context) {
9+
const { electronPlatformName, appOutDir } = context;
10+
if (electronPlatformName !== 'darwin') {
11+
return;
12+
}
13+
14+
const appName = context.packager.appInfo.productFilename;
15+
16+
return await notarize({
17+
appBundleId: 'org.zulip.zulip-electron',
18+
appPath: `${appOutDir}/${appName}.app`,
19+
appleId: process.env.APPLE_ID,
20+
appleIdPassword: process.env.APPLE_ID_PASS,
21+
});
22+
};

0 commit comments

Comments
 (0)