cordova-electron icon indicating copy to clipboard operation
cordova-electron copied to clipboard

Adding `com.apple.security.network.client` to signed MAS build entitlements breaks Electron

Open vialoh opened this issue 5 years ago • 0 comments

Bug Report

Problem

What is expected to happen?

Electron runs the app as usual.

What does actually happen?

Blank screen.

Information

The app builds and works as expected without the com.apple.security.network.client entitlement:

<?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.app-sandbox</key>
  <true/>
  <key>com.apple.security.inherit</key>
  <true/>
  <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.disable-library-validation</key>
  <true/>
  <key>com.apple.security.cs.disable-executable-page-protection</key>
  <true/>
</dict>
</plist>

But of course there is no network access, so when adding this:

  <key>com.apple.security.network.client</key>
  <true/>

It breaks the app, just a blank screen. The logs are unhelpful from what I can see.

I've searched and tried everything I could possibly think of over the past week before making this issue. Many different configurations, provision profiles, cordova/electron versions, etc. Many days going in circles.

Command or Code

cordova build electron --release (also --debug) on Mac for the Mac App Store.

I've tried many different build.json configs, but it currently looks like this:

{
  "electron": {
    "mac": {
      "package": [
        "mas"
      ],
      "signing": {
        "release": {
          "entitlements": "Entitlements.plist",
          "entitlementsInherit": "EntitlementsInherit.plist",
          "provisioningProfile": "embedded.provisionprofile",
          "hardenedRuntime": false,
          "gatekeeperAssess": false,
          "asarUnpack": []
        }
      }
    }
  }
}

Environment, Platform, Device

Mac OSX

Version information

Relevant lines from package.json:

{
  "devDependencies": {
    "cordova-android": "^9.0.0",
    "cordova-electron": "git+https://github.com/apache/cordova-electron.git",
    "cordova-ios": "^6.2.0",
    "cordova-plugin-background-mode": "^0.7.3",
    "cordova-plugin-badge": "^0.8.8",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-inappbrowser": "^5.0.0",
    "cordova-plugin-local-notification": "^0.9.0-beta.2",
    "cordova-plugin-network-information": "^2.0.2",
    "cordova-plugin-purchase": "^10.5.3",
    "cordova-plugin-whitelist": "^1.3.4"
  }
}

I only just recently tried cordova-electron version via GitHub, was previously using v2 from NPM.

I'm on macOS Big Sur 11.2.3 if it makes any difference.

Checklist

  • [x] I searched for existing GitHub issues
  • [x] I updated all Cordova tooling to most recent version
  • [x] I included all the necessary information above

vialoh avatar Apr 04 '21 15:04 vialoh