Codesign skips this directory as I know. … I want my scripts to be signed as well.
You seem to be labouring under a false premise here. Code signing does not skip
Contents/Resources/
. It is most definitely signed, it’s just not signed as code. Rather, it’s signed as a resource under the seal of the parent bundle. This is vital because many things inside
Contents/Resources/
are tantamount to code — the most obvious example being nibs — and so skipping them would compromise the whole code signing story.
Consider this:
$ codesign -v -v xxom.app
xxom.app: valid on disk
xxom.app: satisfies its Designated Requirement
$ cat xxom.app/Contents/Resources/Test.sh
#!/bin/sh
echo "Hello Cruel World!"
$ … make a change to the script …
$ cat xxom.app/Contents/Resources/Test.sh
#!/bin/sh
echo "Goodbye Cruel World!"
$ codesign -v -v xxom.app
xxom.app: a sealed resource is missing or invalid
file modified: …/xxom.app/Contents/Resources/Test.sh
When you put your script in
Contents/Helpers/
it is signed as code. The problem is that your script doesn’t have a convenient place to hold the code signature (that is, there’s no equivalent of the
LC_CODE_SIGNATURE
load command in Mach-O) and thus the signature has to be stored in an extended attribute. This puts you way off the beaten path, and it’s something we recommend against.
So, my advice: Put your script in
Contents/Resources/
and move on.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"