-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hardened signed app not working: container requires user-preference-write or file-write-data sandbox access
#195
Comments
It seems that setting the following content into the entitlements.mac.plist file and referencing to this same file with the flags
I am not sure if this this is the best way to handle this, but for now it is the only way I found how this will work. |
@puresick Ah this may be a duplicate of this open issue: #188 (comment) Did including |
@sethlu Yes, after adding this, it allowed me to run the app with hardened runtime on macos 10.14.5. |
Ah awesome! Thanks for the follow up 🙇 |
@puresick but you removed the sandbox entitlement, right? Is it okay, does it means I didn't run the app in the sandbox? So I cannot find the problem it would emerge in the real App Store environment? |
@dadiorchen Unfortunately, I am not working at the company anymore where I worked on the project this error occured. Also I cannot recal for sure what I did back then, sorry. :( |
@puresick it's fine, I'm working on this problem, I'll let you know the progress if any. |
@dadiorchen curious if you had made any progress. Seeing these errors myself when sandboxed with hardendedRuntime:true |
Problem:
Starting with macos 10.14.5, Apple requires applications to be hardened-signed, uploaded to their notary service and stapled to be able to get verified by gatekeeper to run.
Signing an electron application the "hardened" way (tested with
electron-osx-sign
version 0.4.11) will result in the application to be signed successful, but it cannot be run either on macos 10.14.5 (most recent) and older versions (tested with 10.14.4).Reproducing the problem:
1. Using
electron-quick-start
as reference project by cloning it and installing its dependencies to get it up and running:2. Installing
electron-builder
The current release of
electron-builder
(version 20.41.0) enables passing down the--hardened-runtime
flag - but for this example, we are going to disable signing from electron-builder and runningelectron-osx-sign
manually after building the app!npm i -D electron-builder
3. Preparing needed files for signing
Creating entitlements.mac.plist in project directory and adding entitlements to it needed for hardened signing:
mkdir build
touch build/entitlements.mac.plist
build/entitlements.mac./plist
:touch build/entitlements.inherit.mac.plist
build/entitlements.inherit.mac.plist
:Also adding the
appId
to package.json:4. Building application without signing:
npx electron-builder build -m -c.mac.identity=null
5. Extracting .app and signing it with
electron-osx-sign
unzip dist/electron-quick-start-1.0.0-mac.zip
6. Starting the application:
First, start Console.app and clear the current output to be able to monitor the error outputs the signed app will create.
Starting the signed application via finder or
open electron-quick-start.app
from the project dir.Error Output:
The App will start and then silently crash, showing following erros in the Console.app:
process
cfprefsd
:process
taskgated-helper
:process
taskgated-helper
:process
taskgated-helper
:The following two outputs from
kernel
are appearing multiple times (around 10 times each)process
kernel
:process
kernel
:Does anyone experience similar issues?
EDIT:
Adding the following to
build/entitlements.mac.plist
removes the errors regardingGameController
andpowerlog
:The text was updated successfully, but these errors were encountered: