MacOS:在安装过程中要求 "Full Disk Access"

标签 macos installation pkgbuild

背景

我有一个守护进程可以跟踪系统上的所有事件。 要正常工作,它需要“完全磁盘访问”。

问题

如果用户手动将守护进程添加到“首选项/保护和隐私/隐私/完整磁盘访问”列表中,一切都会按预期进行。问题是我的应用程序是一个守护进程,因此它无权访问 UI。因此,当它访问受限资源时,系统不会提示用户授予“完整磁盘访问权限”。因此,用户可能不会意识到软件未完全运行。

基本上this solution不起作用(对于守护进程来说还不够)。

问题

为了解决这个问题,我想在安装过程中提示用户授予“完整磁盘访问权限”。我不知道如何实现。

是否可以在 pkg 安装过程中授予“完整磁盘访问权限”?如果是怎么办?

最佳答案

So when it accesses restricted resources user can't be prompted to grant "Full Disk Access"

没有应用程序可以提示授予“完整磁盘访问权限”。您可以提示访问其他特权“查找器和文件夹”位置(桌面、文档、下载等),但不提示访问全盘访问位置(邮件数据库等)

尽管它是一个守护进程,但您的守护进程应该能够提示访问“Finders and Folders”。


在 WWDC 2019 上专门讨论了授予对辅助应用程序的访问权限:

macOS 安全性进展 - WWDDC 2019

https://developer.apple.com/videos/play/wwdc2019/701/

时间戳 31:15


And while we're here, I'd like to talk about one of the enhancements that we've made in macOS Catalina to how apps are approved for Full Disk Access, while users can still manually add apps to the list using the plus button here.

One piece of feedback that we've gotten from developers is that it can be awkward for users to locate their app's privileged helpers.

So, now in macOS Catalina, executables that are denied access to files due to a lack of Full Disk Access approval are now pre-populated unchecked.

Here, we see one such helper identified by its executable name.

If that helper were embedded in a bundle, the display name in icon specifying the bundles Info.plist would be displayed instead.


这是 Apple 批准的请求全盘访问的方式。

关于MacOS:在安装过程中要求 "Full Disk Access",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60148608/

相关文章:

installation - InnoSetup,如果选择任何任务则阻止安装

node.js - 创建使用另一个产品 .pkg 的 .pkg 安装程序

java - Java 和 Mojave 的强化运行时

ios - "for char in self"有一个错误说 "type string does not conform to protocol sequencetype"

c++ - 在 Xcode 中检查 STL 容器

php - SugarCRM 安装卡住

installation - Inno Setup 根据可执行调用的结果有条件重新启动

macos - 使用 Productbuild 对 mac 应用程序进行签名和存档,无需使用 xcode 在 Mac App Store 之外分发应用程序

linux - 我可以从损坏的 Raspberry Pi sd 恢复文件吗?

android - opencv,链接C静态库../lib/armeabi-v7a/liblibjpeg.a