castlabs / electron-releases

castLabs Electron for Content Security
https://castlabs.com/resources/downstream/
MIT License
225 stars 43 forks source link

Application quit unexpected: EXC_CORPSE_NOTIFY Namespace SIGNAL, Code 5 Trace/BPT trap: 5 #171

Open ductridev opened 1 year ago

ductridev commented 1 year ago

I'm using electron-builder to build and sign my application. But if I enable sandbox in entitlements for Mac App Store publish then my app won't work. I have tried to re-sign with codesign, and I can confirm that it only work when sign without sandbox key.

  1. 1st attempt is without entitlement file contain sandbox key:

Command line: codesign -s "Apple Distribution: Block Browser INC (Y4NZxxxxxx)" --force --deep --sign - dist/mac-universal/BLOCK.app Then BLOCK.app run normal.

  1. 2nd attempt is with entitlement file contain sandbox key:

Command line: codesign --entitlements build/entitlements.mac.plist -s "Apple Distribution: Block Browser INC (Y4NZxxxxxx)" --force --deep --sign - dist/mac-universal/BLOCK.app entitlements.mac.plist:

<!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.app-sandbox</key>
    <true/>
    <key>com.apple.security.inherit</key>
    <true/>
</plist>

Then BLOCK.app quit unexpected. Error file: error.log

  1. 3rd attempt is with entitlement file and comment sandbox key: Command line: codesign --entitlements build/entitlements.mac.plist -s "Apple Distribution: Block Browser INC (Y4NZxxxxxx)" --force --deep --sign - dist/mac-universal/BLOCK.app entitlements.mac.plist:
    <!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.app-sandbox</key>
    <true/> -->
    <key>com.apple.security.inherit</key>
    <true/>
    </plist>

    Then BLOCK.app run normal.

Packages version:

Build settings:

      "appId": "xxxxxx.block.mac",
      "category": "public.app-category.utilities",
      "provisioningProfile": "./embedded.provisionprofile",
      "target": [
          {
              "target": "pkg",
              "arch": ["universal"]
          }, {
              "target": "dmg",
              "arch": ["universal"]
          }
      ],
      "icon": "build/icons/icon.icns",
      "bundleVersion": "11"
    },

Following #105, so I have after pack hook:

"afterPack": "./afterPackHook.js",

afterPackHook.js:

const fs = require('fs')

exports.default = async function(context) {
  try{
    fs.unlinkSync(context.appOutDir + '/BLOCK.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources/Electron Framework.sig');
  } catch(e){}
}
khwaaj commented 1 year ago

ECS does not support packaging for the App Store. It also relies on features not allowed by by the store guidelines, and would not pass the review.

ductridev commented 1 year ago

Thank you for your reply @khwaaj, so is there any possible way to publish app to mac store?

khwaaj commented 1 year ago

No, unfortunately there is not. There are some old tickets where this has been extensively discussed before, which you can probably find if you want some more information.