Embed file in mac app without breaking codesign

I'm working on a feature for a design mac app that allows designers to export a standalone viewer app that has their design embeded in it. The exported viewer app could then be sent to clients for review. Currently, the feature works by copying a viewer app embeded in the main app's bundle to the user's desktop, and then copying the design file into the viewer (~/Desktop/Viewer.app/Contents/Resources/designFile)


This works great, unless the client doesn't have the "allow apps from anywhere" security setting turned on.


If I enable codesigning for the viewer app, codsigning is broken by copying the design file into the app's resources folder. Pre-mavricks you could specify files that codesign should ignore, but this is no longer possible.


So my quesiton is this: is there some other way to make this viewer app so that it's codesigned?

So my quesiton is this: is there some other way to make this viewer app so that it's codesigned?

Not really. Code signing the viewer won’t work because:

  • you can’t code sign it after adding the document because that would require your main app to include a copy of your code signing identity, which would be Bad™

  • you can’t add the document after code signing the viewer because that will break the code signature

OTOH, not code signing the viewer is not going to be a good option in the long term. Apple really wants all code on the platform to be signed, for obvious security reasons.

Honestly, I think the simplest option here is to not embed the document within the viewer. Instead of saving the viewer with the document embedded within it, create a folder with two items, the viewer and the document. Then, if the user double clicks either one the viewer will launch and can open the document.

Beyond that the options get really non-obvious.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Embed file in mac app without breaking codesign
 
 
Q