Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why suddenly did all my apps start to crash with an EXC_CRASH (Code Signature Invalid) after sharing one of them via a cloud service?

Tags:

Yesterday, I was working on a new build of my app. To test it on another computer, I dragged and dropped it on a folder that is shared among a few Mac computers I own through a cloud service. I thought this could be an expedited way of distributing an app to be tested on another computer running an older version of the macOS (10.11).

The first thing I noticed is that I could not launch my latest build on the test computer. I investigated and found out by opening the .app folder that all executables had been disabled (they looked like plain document files instead of having an icon looking like Terminal's). OK, I thought, so apparently you cannot share apps like this. You need to always distribute them via a disk image or a zip file, preferably via a signed disk image if you are not doing that via the Mac App Store.

I didn't think much of this. As I had Xcode installed on the test machine, which is at another location, I rebuilt my app and everything worked as I expected.

However, when I went back home and tried to work on my app again, I noticed that one of its helpers started to crash on launch with an EXC_CRASH (Code Signature Invalid) exception. Then I tried to launch my main app, and the same happened. I tried to uninstall the app with my uninstaller and the same happened.

So, my question is: how could this be? Why do all my apps start to crash, when just minutes before all my apps worked fine?

like image 678
jvarela Avatar asked Jan 20 '17 20:01

jvarela


1 Answers

Basically, I found out the reason why this was happening is because if you try to distribute your apps directly through a folder shared via a cloud service, you can get your Mac Developer certificate revoked by Apple. I determined this by running the following command on my apps:

spctl -a -v path/to/my/app

And lo and behold, I got this result:

path/to/my/app: CSSMERR_TP_CERT_REVOKED

My solution was to go to my developer account and click on the Revoke button to delete this blacklisted certificate and then create a new one as instructed in the site.

Fortunately, older versions of my app were not affected, because they had been signed by an earlier certificate. However, be ready to receive lots of complaints and to tell your users to re-download a resigned app if the apps that have been distributed already to your clients were signed by a revoked certificate. They will be killed on launch with this EXC_CRASH exception. Just tell your co-workers not to have the "brilliant" idea of quickly distributing apps via a cloud service. You may end up having your Mac developer certificate revoked.

like image 82
jvarela Avatar answered Sep 23 '22 19:09

jvarela