Hello,
this is my first post here, I hope I am not asking what is considered to be common knowledge.
After a long and very frustrating day, I have found out why copying out my (correctly signed and notarised) MyProg.app from the (correctly signed and notarised) enclosing DMG breaks it ("Is damaged and can't be opened"): it seems that D&D or C&P from Finder does something to destroy the notarisation.
spctl --ignore-cache --assess -vvvv MyProg.app
after I copy MyProg.app out of the DMG using FInder gives
MyProg.app: a sealed resource is missing or invalid
If I copy MyProg.app from the DMG container into another directory by "cp -R" or "ditto" instead of D&D or C&P in Finder, everything works as it should and the notarisation is not broken.
Is there a way to copy MyProg.app out of the enlocing DMG and keep the notarisation without resorting to command line? Dropping down to command line is not a problem for me, but it is for quite a few of my users - not everybody is comfortable with command line, and debugging what they did wrong sometimes turns out to be quite a futile undertaking.
Earlier I wrote:
The most common cause of problems like this is that the app’s bundle isn’t structured according to the rules in Posting a Crash Report.
D’oh! Wrong hot key. That was link was meant to be to Placing Content in a Bundle.
You wrote:
Here are the correct ones you requested:
Thanks. Sadly, I asked for the wrong info here. What I actually need is the output from:
% codesign -v -vvv --deep --strict MyProg.app
Clearly I shouldn’t be answering DevForums questions after 23:00 )-:
However, I think you’ve already found the issue here:
"non-ascii" characters in file names … Can that be important?
Yes. This is a known issue with code signing (r. 68829319). In Unicode many characters can be rendered in different ways. For example, an Á (A acute) can be encoded either precomposed, as U+00C1 (LATIN CAPITAL LETTER A WITH ACUTE), or decomposed, as U+0041 U+0301 (LATIN CAPITAL LETTER A followed by a COMBINING ACUTE ACCENT). If copying the files changes this rendering, it breaks the code signature.
On HFS Plus this was rarely a problem because all file names were canonically normalised. However, APFS is normalisation preserving [1], which means that the rendering of your file names can vary based on how you copy them. That’s why a Finder copy breaks the code signature but ditto does not.
Ultimately this is Apple’s bug to fix but, right now, the only good solution is to stick to ASCII file names within your bundle.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] It’s also normalisation insensitive but that only goes so far. The way that code signing uses the file system means that this normalisation insensitivity doesn’t help it.