简体   繁体   English

是否有任何 API 可以获取 macOS 中应用程序的完整磁盘访问信息?

[英]Is there any API to get Full Disk Access info for an application in macOS?

Applications which require Full Disk Access in macOS 10.14 Mojave must instruct their users to navigate into System Preferences > Security & Privacy > Full Disk Access and add the application to the whitelist.在 macOS 10.14 Mojave 中需要全盘访问的应用程序必须指示其用户导航到系统偏好设置 > 安全和隐私 > 全盘访问并将应用程序添加到白名单。 This procedure is complicated and will frustrate new users of such an app.此过程很复杂,会使此类应用程序的新用户感到沮丧。

There should be a API for this – an asynchronous function which, when called by an app, would present the user with a dialog requesting Full Disk Access and, if the user clicks OK, automatically enter the calling app into the Full Disk Access whitelist.应该有一个 API——一个异步函数,当被应用程序调用时,会向用户显示一个对话框,请求全盘访问,如果用户点击确定,自动将调用应用程序输入到全盘访问白名单中。 This function should pass the user's YES or NO to its completion handler.此函数应将用户的 YES 或 NO 传递给其完成处理程序。 There should be another function which would indicate an app's Full Disk Access status.应该有另一个功能可以指示应用程序的完整磁盘访问状态。

It appears that Apple has added API to check for AppleEvent authorization.看来苹果已经添加了 API 来检查 AppleEvent 授权。 Have they added something similar for Full disk access?他们是否为完整磁盘访问添加了类似的内容? If yes, please redirect me to that API.如果是,请将我重定向到该 API。

There is no API that prompts the user to enable Full Disk Access.没有提示用户启用全盘访问的 API。

New in Catalina, if an app attempts to access files that require Full Disk Access, that app will be added, unchecked , to the Full Disk Access table view. Catalina 中的新功能,如果应用程序尝试访问需要完全磁盘访问权限的文件,则该应用程序将被添加到完全磁盘访问表视图中,未选中

So, now in macOS Catalina, executables that are denied access to files due to a lack of Full Disk Access approval are now prepopulated unchecked.因此,现在在 macOS Catalina 中,由于缺乏完整磁盘访问权限而被拒绝访问文件的可执行文件现在未选中预填充。

https://asciiwwdc.com/2019/sessions/701 https://asciiwwdc.com/2019/sessions/701

That at least makes it a bit easier to direct users to enable Full Disk Access for an app.这至少使指导用户为应用程序启用完整磁盘访问变得更容易一些。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM