diff --git a/build/entitlements.mac.inherit.plist b/build/entitlements.mac.inherit.plist
new file mode 100644
index 00000000..ee90b853
--- /dev/null
+++ b/build/entitlements.mac.inherit.plist
@@ -0,0 +1,14 @@
+
+
+
+
+ com.apple.security.cs.allow-jit
+
+ com.apple.security.cs.allow-unsigned-executable-memory
+
+ com.apple.security.cs.disable-library-validation
+
+ com.apple.security.cs.allow-dyld-environment-variables
+
+
+
diff --git a/build/entitlements.mac.plist b/build/entitlements.mac.plist
new file mode 100644
index 00000000..ee90b853
--- /dev/null
+++ b/build/entitlements.mac.plist
@@ -0,0 +1,14 @@
+
+
+
+
+ com.apple.security.cs.allow-jit
+
+ com.apple.security.cs.allow-unsigned-executable-memory
+
+ com.apple.security.cs.disable-library-validation
+
+ com.apple.security.cs.allow-dyld-environment-variables
+
+
+
diff --git a/build/notarize.js b/build/notarize.js
new file mode 100644
index 00000000..4c072696
--- /dev/null
+++ b/build/notarize.js
@@ -0,0 +1,39 @@
+const { notarize } = require('@electron/notarize');
+
+exports.default = async function notarizing(context) {
+ const { electronPlatformName, appOutDir } = context;
+
+ // Only notarize macOS builds
+ if (electronPlatformName !== 'darwin') {
+ return;
+ }
+
+ // Skip notarization if credentials are not provided
+ const appleId = process.env.APPLE_ID;
+ const appleIdPassword = process.env.APPLE_ID_PASSWORD;
+ const teamId = process.env.APPLE_TEAM_ID;
+
+ if (!appleId || !appleIdPassword || !teamId) {
+ console.log('Skipping notarization: Apple ID credentials not provided');
+ return;
+ }
+
+ const appName = context.packager.appInfo.productFilename;
+
+ console.log(`Notarizing ${appName}...`);
+
+ try {
+ await notarize({
+ appBundleId: 'com.karmaa.termix',
+ appPath: `${appOutDir}/${appName}.app`,
+ appleId: appleId,
+ appleIdPassword: appleIdPassword,
+ teamId: teamId,
+ });
+
+ console.log(`Successfully notarized ${appName}`);
+ } catch (error) {
+ console.error('Notarization failed:', error);
+ // Don't fail the build if notarization fails
+ }
+};
diff --git a/electron-builder.json b/electron-builder.json
index 0981a6df..9b3f7dec 100644
--- a/electron-builder.json
+++ b/electron-builder.json
@@ -98,14 +98,16 @@
"category": "public.app-category.developer-tools",
"hardenedRuntime": true,
"gatekeeperAssess": false,
- "entitlements": "build/entitlements.mas.plist",
- "entitlementsInherit": "build/entitlements.mas.inherit.plist",
+ "entitlements": "build/entitlements.mac.plist",
+ "entitlementsInherit": "build/entitlements.mac.inherit.plist",
"type": "distribution",
"minimumSystemVersion": "10.15"
},
"dmg": {
- "artifactName": "termix_macos_${arch}_${version}_dmg.${ext}"
+ "artifactName": "termix_macos_${arch}_${version}_dmg.${ext}",
+ "sign": true
},
+ "afterSign": "build/notarize.js",
"mas": {
"provisioningProfile": "build/Termix_Mac_App_Store.provisionprofile",
"entitlements": "build/entitlements.mas.plist",