Notarization or Gatekeeper issues when downloading archive with certain Apps

I have a strange issue with Notarization or Gatekeeper under macOS 10.15.6.

After signing and exporting my App from the Xcode Organizer, I'm using atool to notarize my App (*). This works fine and when everything is finished, I also check with…

Code Block
spctl -a -vv App

I get the status…

Code Block
App: accepted
source=Notarized Developer ID
origin=Developer ID Application: xxxx

So everything is fine.

I create a ZIP archive with the App and some read.me files and put it on my web page so users can download the App.

So now the weird which I don't understand:

If I download the ZIP archive with Safari, extract the archive, I can launch the App and get a notification from gatekeeper that the App was downloaded from the internet, it was checked for malware, none were found and I can launch the App and cancel. The App works fine from now on (why do I get this warning in the first place? Shouldn't the Notarization and signing of the App prevent these kinds of warnings?)

For the App from the ZIP spclt reports:
Code Block
App: accepted
source=Notarized Developer ID
origin=Developer ID Application: xxxx


If I download the archive with the old version of my App using its "search for Update" feature (the App was originally developed and notarised under macOS 10.14, written in Objective C), and extract the ZIP archive and launch the App, it launches without any Gatekeeper warning (which is what I would have expected).

For the App from the ZIP spclt reports:
Code Block
App: accepted
source=Notarized Developer ID
origin=Developer ID Application: xxxx



If I launch the App with the new(!) version of my App (a complete rewrite in Swift, so this is a new Code project, but with the same bundle ID as the old App), extract the Archive and try to launch the downloaded App, the finder gives me an Error message "The App 'App' can not be opened" (no further description). Launching the App fails!!!

For the App from the ZIP spclt reports:
Code Block
App.app: File created by an AppSandbox, exec/open not allowed



So somehow the Finder seems to treat the ZIP file different, depending of the App which has downloaded the file. This makes no real sense to me. The App is signed and notarized correctly, shouldn't this be enough to let the Finder check that the App is not modified and can be launched without error or warning?


So my question is, why does it behave in three different ways with exactly the same ZIP archive, depending of the App which has downloaded the ZIP archive.

And the most important question is: What do I need to do so that my new version of may App can download the ZIP archive (for the search for Updates" feature) so that when extracting the ZIP the App can be opened successfully without error?






Notes:
(*) Xcode is unable to notarize my App. It always fails with the error, that I had to accept certain contracts first. This seems to be an old of Xcode. This issue seems to occur when a developer is a member of other developer teams. Xcode seems to check the wrong contracts (from the other teams), not your own. Fortunately "atool" works.

Replies

New projects have the sandbox turned on by default. The sandbox won't let you create an executable.
The App is not sandboxed. In the project settings the "App Sandbox" capability is not used. The "hardened Runtime" is active, which is required for Notarization.

But even if it would be sandboxed, it should nevertheless be possible to launch and use the App.

Why it is working when downloaded with Safari or with the old version of my App, and why does the App from the ZIP not lanuch when downloaded from the new version of my App? As I said, the App is properly signed and notarized.
What do I need to do to make sure that my new App can download a ZIP archive with an App update, so that when extracting the ZIP, the App from the ZIP can be launched?


Shouldn't the Notarization and signing of the App prevent these kinds
of warnings?

No. Passing notarisation is a pretty low bar and thus Gatekeeper still requires users to confirm that they actually intended to run your code.

If I launch the App with the new(!) version of my App

It really does sound like your new app is sandboxed, so let’s check that first. What does xattr -l repor on that zip archive?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Actually the App is not sandboxed.

But I guess I've found out what's going on here. The problem is WKWebView. If the download of the file is done by WKWebView, then this problem occurs. The reason is probably that WKWebView is using its own private processes to load data from the internet and to render content. So it doesn't matter if the App is sandboxed or not, WKWebViews internal processes are probably sandboxed, and so...

If the downloads are made "outside" of WKWebView, there are no problem anymore.