Since Harman will be taking over the support and development of the AIR platform I've shot them an email explaining the problem and referencing this thread. (Adobe.Support@harman.com) / Harman - Adobe Partnership - HARMAN
I have it working!!! Woooohoooo!
DHL83's correspondence with Apple and reference to the Electron thread on Apple's Developer support site provided me with some ideas for googling whether entitlements could be added for apps produced by 3rd party tools such as the Flex SDK. After a lot of trial-and-error, I worked out what entitlements are required.
Here are the steps in addition to the signing script I posted above:
1. You need to create an Entitlements file which will look like this:
<?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/>
</dict>
</plist>
Thismust be created in XCode otherwise get an error about blobs not being correct:
HomeDirXCodePropertyList.plist: unrecognized blob type (accepting blindly)
HomeDirXCodePropertyList.plist: invalid length in entitlement blob
To create in XCode, do this:
In XCode, File->New->File...
Choose MacOS tab -> Resource -> Property List
Right click on the document -> Property List Type -> Entitlements File
Add Row using + button.
Select Allow Execution of JIT-compiled code and select Boolean value YES
Add Row using + button
Select Allow Unsigned Executable Memory and select Boolean value YES
Save the file (I called it entitlements.plist) and reference it in the .app signing line.
2. Change the script you use for signing the .app to reference this file:
codesign --force --options runtime --deep --sign "Developer ID Application: My Company, Inc (AB1CD2E3FG)" --entitlements "/Users/username/Documents/entitlements.plist" "/Users/username/Documents/out/MyApp.app"
Check that you don't get any errors from the entitlements file.
3. Use product build in the script as before (no changes) to create the .pkg
4. As before, submit the app for Notarization, then staple once it completes successfully.
My testing has been as follows:
1. Delete the .app files from my machine.
2. Upload the .pkg file to a web server.
3. Download it and install on 10.14.5 Mojave.
It installs and runs without the previous codesign error. Hope it works for others!