-
Notifications
You must be signed in to change notification settings - Fork 161
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
Codesigning and Notarizing fbs built .app bundles #29
Comments
Thank you for your offer! That would be very interesting indeed. Please just post the info here; with your permission i'll then integrate it into fbs, or the docs. |
I apologize I don't have this in guide form; I'll write this out and embed links as relevant. I realized I wasn't explicit in my original post but feel free to take the content I post here and reword/rephrase/embed into docs as you see fit. if you find the information useful for integrating into I should also point the lessons/pitfalls I've come across are by no means exhaustive, I can only comment on issues I have come across, or issues I've seen reports of. MotivationStarting with macOS 10.15, the default security settings will be to require all applications be notarized. Notarization involves sending your
Before you get startedYou will need the following things:
You can get this certificate by signing up for an Apple Developer account, or joining an existing group and having the group admin give you access to the key. This is required for codesigning. For notarization, you will need your own apple developer account, with a application specific password (to get around the 2FA); it is recommended that these credentials are stored in your non-iCloud keychain. Prepare the Bundle
Code SigningAfter fixing the bundle, you are now ready to codesign -fs "$CODESIGN_ID" --deep --force --verbose -o runtime --preserve-metadata=identifier,entitlements,requirements,runtime --timestamp ./target/MyPkg.app Where Some of the documentation is explicit for not using The next step we want to do is simulate "moving" the .app bundle. The reason we do this is part of the code signing signature checks the extended attributes, so if we verified the codesign signature, it may return "Valid", but the moment the .app bundle is moved, the codesign verficiation could fail. To simulate the move run the command xattr -cr ./target/MyPkg.app Next step is to verify the codesign is valid, I do that through two separate methods: codesign --verify --verbose=4 ./target/MyPkg.app
spctl --assess --verbose ./target/MyPkg.app This should both return no errors, or "valid" results. When this is done, you now have a NotarizationThis link will be of reference First thing you will want to do is have your apple developer ID credentials in the keychain, along with your application specific password. The link above has the steps to do that. The next step is to notarize the application. As we cannot upload a directory, we will upload the
You will get a bundle ID to check the status of it later, along with an email if it is rejected or accepted. Caveat At The Time of this WritingCurrently PySide2 5.12.4 and 5.13.0 (haven't tested other versions) have You can download/build PySide2 locally to get around this (I have not done this yet). I have opened a bugreport here. If this is relevant to you, I would encourage commenting there. I typed this out in a bit of a rush, no doubt I missed stuff, @mherrmann let me know where you would like more detail/references and I'll edit this post to reflect that. |
Thank you very much for this. I need to get access to macOS 10.13+ so I can have XCode 10, which you wrote is required. I'll post back here. |
I should update that I got my application to notarize, but it was not easy!
Here is the contents of my
|
Lastly, I'm going to write up a detailed blog posts about my experience, and various edge cases I ran into. I do hope that my experience can help improve I do want to say the notarization process is easy to do by hand, but any kind of automated fashion via build pipeline will be challenging due to the asynchronous nature of the process (upload package to Apple, wait on approval, you can check the status via command line tool, ..you're given an email when accepted/rejected (status check tool will say pending, failed or accepted as well)). |
Just an update on this: I'm afraid I'm extremely busy right now and will not get to this soon, also because it seems it's not required for me to do this for fman. I have an old Apple Developer Certificate, which (I think) does not require notarization. If my situation changes, I will update here. |
Notarization will be required with macOS 10.15 which is to be released pretty soon. Not sure how this would be integrated into fbs, I'm envisioning a reference in documentation for the time being. |
My fbs "release"d PyQt5 app fulfill.app only runs from the /Applications .app bundle if I double-click the fulfill Unix executable inside the bundle. It works fine from there. But if I start fulfill by clicking on the bundle fulfill.app in /Applications, the icon shows up for a second or two in the dock and then disappears. I can't find any error message. Looked in console and have Sentry configured and tested for the app. It is NOT codesigned. Shouldn't I get an error popup from MacOS if that is the problem? Disregard, I set full disk access in System Permissions and it solved the problem. Sorry to bother. |
I have been working on notarizing a
fbs
generated.app
bundle. I knowfbs
currently does not support code signing and notarization, but I would be happy to post what I've learned; and various steps and fixes along the way if it would help integrate these features at some point. I currently have my application codesigned, and am working on the notarization process.I'm not sure where the appropriate place to put that information would be; hence opening the issue and seeing what you would prefer.
Thanks again for making this awesome package.
The text was updated successfully, but these errors were encountered: