macOS Entitlements audio-input vs. microphone

跟風遠走 提交于 2019-12-14 03:50:00

问题


For the macOS sandbox there are two entitlement keys:

com.apple.security.device.audio-input
com.apple.security.device.microphone

I tested both and both allow microphone input.

What is the difference between them?


回答1:


com.apple.security.device.microphone is a sandbox entitlement. If you want to use the microphone in a sandboxed app, you will need to enable it,

com.apple.security.device.audio-input is a hardened runtime entitlement. If you want to use the microphone in an app built with the hardened runtime, you will need to enable it.

If your app is both sandboxed and hardened, you will want to enable both.

Sandboxing and hardening provide overlapping protections in this case.

In a sandboxed app, if you don't have the com.apple.security.device.microphone entitlement, your app will not be able to access the microphone.

In a hardened app, if you don't have the com.apple.security.device.audio-input entitlement, your app will not be able to access the microphone or any audio input using Core Audio,

This provides a good explanation of the relationship between sandboxing and hardening.

We can see in Xcode 10 that the Resource Access section of the Hardened Runtime shows a great deal of overlap with the App Sandbox, while the Runtime Exceptions section has functionality unique to the hardened runtime. What's the reason for the overlap? The sandbox was designed mainly for the App Store, while the hardened runtime was designed mainly for Developer ID. I've just explained in detail how the two technologies can apply to the same app and don't depend on the distribution method, but in the near future the majority of apps will probably use at most one of the two: sandboxing for Mac App Store apps and hardening for notarized Developer ID apps. This is why duplicate entitlements exist.



来源:https://stackoverflow.com/questions/49595811/macos-entitlements-audio-input-vs-microphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!