Is there any additional work that developers need to do to enable File Quarantine for their apps besides adding LSFileQuarantineEnabled
to their Info.plist
(and all the helpers)?
All files made by the app's processes should be quarantined by macOS without any additional changes to the app by the developer correct?
Thanks!
Should they be using any special file write API to additionally support File Quarantine?
Nope. Consider this snippet:
let s = """
#! /bin/sh
echo 'Hello Cruel World!'
"""
let u = FileManager
.default
.homeDirectoryForCurrentUser
.appendingPathComponent("test.command")
.absoluteURL
try! s.write(to: u, atomically: true, encoding: .utf8)
_ = chmod(u.path, 0o755)
If LSFileQuarantineEnabled
is not present, the resulting ~/test.command
file opens and runs in Terminal. If it is, Terminal stops with a Gatekeeper alert.
Having said that, there are advantages in applying quarantine directly (using the .quarantinePropertiesKey
property) in that it gives you more control.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"