App not re-signed on resource update causing signature to break

Originator:m.hanauska
Number:rdar://41254808 Date Originated:June 19 2018
Status:Open Resolved:
Product:Xcode Product Version:10.2
Classification:Serious Bug Reproducible:Always
 
Area:
Xcode

Summary:
When I use the new build system in Xcode 10 and change a resource file (any file that is part of my resource copy phase), Xcode correctly determines that all it needs to do is copying this one file but it doesn't re-sign the app bundle after copying it, causing my app to start with an invalid signature and this has serious implications. For all the years, this was never a problem with the old build system. It has been broken 

Steps to Reproduce:
1. I build a project, the result is an app bundle.
2. I ask code sign if the app is signed correctly and code sign says it is.
3. I just change one string in a strings file, nothing else.
4. I build again and see that Xcode copies the file to the app bundle but nothing else.
5. I ask code sign if the app is signed correctly and is says no as the strings file has been modified.


Expected Results:
Whenever Xcode modifies an app bundle that is signed, it must make sure the signature is updated.


Actual Results:
Xcode just replaces resources but doesn't update anything. The result is that unless a code file was touched, any incremental build that updates any bundle resource of an app causes Xcode to produce a broken (incorrectly signed) application bundle. Thus any APIs or Entitlements that only work for correctly signed apps will fail when running this app in the debugger! The only ways to fix this are to either always touch a code file prior to building, always perform a lengthy clean build or always manually re-signing the app bundle after building it.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!