Hi our team is looking into feasibilities of appending customized data to personalized installer, so that we can make new users onboarding experience better. I did some investigations.
-
Append token data to xattr to a dmg, I went though this smoothly. I can successfully retrieve the data back, and the app can still be launched successfully. Want to make sure this doesn't require the dmg to be re-signed and re-notarized, and I didn't miss any steps in between
-
I created a fake simulation app try to sign and notarize. Signing the dmg seems to be successful, but when I notarize, it gave me back Invalid status. Is there anything wrong?
This is the signature:
Executable=/Users/myname/myname/poc/MySimulation.dmg
Identifier=MySimulation
Format=disk image
CodeDirectory v=20200 size=304 flags=0x0(none) hashes=1+6 location=embedded
Hash type=sha256 size=32
CandidateCDHash sha256=e2a149614f6e0e3939db3a
4c762adda0e8c24
CandidateCDHashFull sha256=e2a149614f6e0e3939db3a3054adda0e8c24f597ddf4c4503cd27fb83821
Hash choices=sha256
CMSDigest=e2a149614f6e0e3939dba3054c62adda0e8c24f597ddf4c4503cd27fb83821
CMSDigestType=2
CDHash=e2a149614f6e0e39393a3054c762adda0e8c24
Signature size=4789
Authority=Apple Development: myId (someId)
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Signed Time=Oct 14, 2024 at 3:46:08 PM
Info.plist=not bound
TeamIdentifier=W3TC3HXUZC
Sealed Resources=none
Internal requirements count=1 size=188
-
Do you have any other recommendations for us to append some data that doesn't break signing / notarization?
My preferred option for this is to set an extended attribute on the app rather than on the disk image. Specifically, the com.apple.application-instance
extended attribute, which is specifically (albeit obscurely :-) documented for this sort of thing. See the discussion in TN2206 macOS Code Signing In Depth [1].
The upsides to this approach are:
-
It’s actually a documented and supported use case.
-
You don’t have to do anything gnarly to get things working when your app is translocated.
The main downside is that this attribute is within your disk image. That means you’ll have to rebuild the disk image on the fly for each user. That’s not a problem from a signing and notarisation perspective: The system doesn’t require that disk images be notarised, so you can sign and notarise your app and you’re done. However, it make present infrastructure problems because building disk images is something you do on the Mac.
One way around that is to move from a disk image to a zip archive.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] It’s weird referencing TN2206 again. I used to reference it all the time, but these days we have much better code signing documentation. Yay!