From 30ad8150a9f2a3dfc68b9c0f11338f6d8ef0f32d Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Fri, 19 Mar 2021 17:51:08 +0900
Subject: [PATCH] refs #2254 Notarize app in dmg build
---
build/notarize.js | 17 +++++++++++++++++
package.json | 8 +++++++-
plist/entitlements.mac.plist | 8 ++++++++
3 files changed, 32 insertions(+), 1 deletion(-)
create mode 100644 build/notarize.js
create mode 100644 plist/entitlements.mac.plist
diff --git a/build/notarize.js b/build/notarize.js
new file mode 100644
index 00000000..5319b474
--- /dev/null
+++ b/build/notarize.js
@@ -0,0 +1,17 @@
+const { notarize } = require('electron-notarize')
+
+exports.default = async function notarizing(context) {
+ const { electronPlatformName, appOutDir } = context
+ if (electronPlatformName !== 'darwin') {
+ return
+ }
+
+ const appName = context.packager.appInfo.productFilename
+
+ return await notarize({
+ appBundleId: 'org.whalebird.desktop',
+ appPath: `${appOutDir}/${appName}.app`,
+ appleId: process.env.APPLE_ID,
+ appleIdPassword: process.env.APPLE_PASSWORD
+ })
+}
diff --git a/package.json b/package.json
index b3de6014..f28dd8e4 100644
--- a/package.json
+++ b/package.json
@@ -56,7 +56,9 @@
"dist/electron/**/*",
"build/icons/*"
],
+ "afterSign": "build/notarize.js",
"dmg": {
+ "sign": false,
"contents": [
{
"x": 410,
@@ -81,7 +83,11 @@
]
}
],
- "category": "public.app-category.social-networking"
+ "category": "public.app-category.social-networking",
+ "entitlements": "plist/entitlements.mac.plist",
+ "entitlementsInherit": "plist/entitlements.mac.plist",
+ "hardenedRuntime" : true,
+ "gatekeeperAssess": false
},
"win": {
"icon": "build/icons/icon.ico",
diff --git a/plist/entitlements.mac.plist b/plist/entitlements.mac.plist
new file mode 100644
index 00000000..d6b93bc0
--- /dev/null
+++ b/plist/entitlements.mac.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ com.apple.security.cs.allow-unsigned-executable-memory
+
+
+