So I've been trying to sign my application for mac os for about a week now to no avail. I've settled on using electron builder. Though my application just keeps erroring. returning this.
{
"logFormatVersion": 1,
"jobId": "3891936e-8019-4072-a8ed-28d47c2eee9d",
"status": "Invalid",
"statusSummary": "Archive contains critical validation errors",
"statusCode": 4000,
"archiveFilename": "SYQEL-VJ.zip",
"uploadDate": "2021-01-01T01:46:28Z",
"sha256": "a354f483b08bd240d79a7ae0e019deeca4fcd517b7d673b332e3f31706ecbd8f",
"ticketContents": null,
"issues": [
{
"severity": "error",
"code": null,
"path": "SYQEL-VJ.zip/SYQEL-VJ.app/Contents/MacOS/SYQEL-VJ",
"message": "The binary is not signed.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "SYQEL-VJ.zip/SYQEL-VJ.app/Contents/MacOS/SYQEL-VJ",
"message": "The signature does not include a secure timestamp.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "SYQEL-VJ.zip/SYQEL-VJ.app/Contents/MacOS/SYQEL-VJ",
"message": "The executable does not have the hardened runtime enabled.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "SYQEL-VJ.zip/SYQEL-VJ.app/Contents/Library/LoginItems/SYQEL-VJ Login Helper.app/Contents/MacOS/SYQEL-VJ Login Helper",
"message": "The binary is not signed.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "SYQEL-VJ.zip/SYQEL-VJ.app/Contents/Library/LoginItems/SYQEL-VJ Login Helper.app/Contents/MacOS/SYQEL-VJ Login Helper",
"message": "The signature does not include a secure timestamp.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "SYQEL-VJ.zip/SYQEL-VJ.app/Contents/Library/LoginItems/SYQEL-VJ Login Helper.app/Contents/MacOS/SYQEL-VJ Login Helper",
"message": "The executable does not have the hardened runtime enabled.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "SYQEL-VJ.zip/SYQEL-VJ.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework",
"message": "The binary is not signed.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "SYQEL-VJ.zip/SYQEL-VJ.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework",
"message": "The signature does not include a secure timestamp.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "SYQEL-VJ.zip/SYQEL-VJ.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib",
"message": "The binary is not signed.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "SYQEL-VJ.zip/SYQEL-VJ.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib",
"message": "The signature does not include a secure timestamp.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "SYQEL-VJ.zip/SYQEL-VJ.app/Contents/Frameworks/SYQEL-VJ Helper.app/Contents/MacOS/SYQEL-VJ Helper",
"message": "The binary is not signed.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "SYQEL-VJ.zip/SYQEL-VJ.app/Contents/Frameworks/SYQEL-VJ Helper.app/Contents/MacOS/SYQEL-VJ Helper",
"message": "The signature does not include a secure timestamp.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "SYQEL-VJ.zip/SYQEL-VJ.app/Contents/Frameworks/SYQEL-VJ Helper.app/Contents/MacOS/SYQEL-VJ Helper",
"message": "The executable does not have the hardened runtime enabled.",
"docUrl": null,
"architecture": "x86_64"
}
]
}
So i've poked around and saw other people had a similar error but nothing i did they suggested has worked. Here is my package.json
{
"name": "SYQEL-VJ",
"description": "SYQEL VJ Application",
"version": "1.0.0",
"private": true,
"author": {
"name": "SYQEL LLC",
"email": "hello@syqel.com",
"url": "https://www.syqel.com"
},
"build": {
"appId": "com.****.****",
"productName": "SYQEL-VJ",
"afterSign": "./afterSignHook.js",
"mac": {
"icon": "./public/assets/icon.icns",
"entitlements": "./entitlements.plist",
"target": [
"mas"
]
},
"mas": {
"hardenedRuntime": false,
"provisioningProfile": "build/embedded.provisionprofile",
"entitlements": "build/entitlements.mas.plist",
"entitlementsInherit": "build/entitlements.mas.inherit.plist",
"gatekeeperAssess": false,
"asarUnpack": []
},
"win": {
"certificateFile": "./SYQEL.pfx",
"certificatePassword": "*****!",
"icon": "build/assets/icon.ico"
},
"files": [
"build/**/*",
"node_modules/**/*"
],
"directories": {
"buildResources": "assets",
"output": "out"
}
},
"dependencies": {
"@iconify/icons-ion": "^1.1.0",
"@iconify/react": "^1.1.3",
"address": "^1.1.2",
"axios": "^0.21.0",
"butterchurn": "^2.6.7",
"butterchurn-presets": "^2.4.7",
"electron-is-dev": "^1.2.0",
"electron-notarize": "^1.0.0",
"electron-settings": "^4.0.2",
"jwt-decode": "^3.1.2",
"node-machine-id": "^1.1.12",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-router-dom": "^5.2.0",
"react-scripts": "2.1.5",
"styled-components": "^5.2.1"
},
"homepage": "./",
"main": "public/electron.js",
"scripts": {
"start": "rescripts start",
"build": "rescripts build",
"test": "rescripts test",
"eject": "react-scripts eject",
"electron-dev": "cross-env concurrently \"cross-env BROWSER=none yarn start\" \"wait-on http://localhost:3000 && electron .\"",
"postinstall": "electron-builder install-app-deps",
"preelectron-pack": "yarn build",
"electron-pack": "build -m"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"@rescripts/cli": "^0.0.10",
"@rescripts/rescript-env": "^0.0.5",
"concurrently": "^4.1.2",
"cross-env": "^7.0.3",
"electron": "^4.2.12",
"electron-builder": "^20.44.4",
"typescript": "^3.9.7",
"wait-on": "^3.3.0"
}
}
my current aftersign.js
// See: https://medium.com/@TwitterArchiveEraser/notarize-electron-apps-7a5f988406db
const fs = require('fs');
const path = require('path');
var electron_notarize = require('electron-notarize');
module.exports = async function (params) {
// Only notarize the app on Mac OS only.
if (process.platform !== 'darwin') {
return;
}
console.log('afterSign hook triggered', params);
// Same appId in electron-builder.
let appId = 'com.****.****'
let appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`);
if (!fs.existsSync(appPath)) {
throw new Error(`Cannot find application at: ${appPath}`);
}
console.log(`Notarizing ${appId} found at ${appPath}`);
try {
await electron_notarize.notarize({
appBundleId: appId,
appPath: appPath,
appleId: "*****@gmail.com",
appleIdPassword: "***-****-***-****",
});
} catch (error) {
console.error(error);
}
console.log(`Done notarizing ${appId}`);
};
and my entitlements
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.debugger</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
</dict>
</plist>