如何设置`com.apple.developer.driverkit.transport.usb` 权限? [英] How to set `com.apple.developer.driverkit.transport.usb` entitlement?

查看:44
本文介绍了如何设置`com.apple.developer.driverkit.transport.usb` 权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定如何在我的 dext 权利文件中设置 com.apple.developer.driverkit.transport.usb 键.Info.plist 文件已经包含 IOKitPersonalities 字典,并阅读了关于 com.apple.developer.driverkit.transport.usb 字典它看起来应该包含与 IOKitPersonalities 条目具有相同信息的条目.

I am unsure about how to set the com.apple.developer.driverkit.transport.usb key in my dext entitlements file. The Info.plist file already contains the IOKitPersonalities dictionary, and reading about the com.apple.developer.driverkit.transport.usb dictionary it looks like it should contains entries with the same information as the entries of IOKitPersonalities.

WWDC 关于驱动程序套件的视频 中显示的内容到:

<key>com.apple.developer.driverkit.transport.usb</key>
<true/>

当我将其设置为 时,系统扩展启动.在我看到来自应用程序的日志行之前,我确实看到了一些这样的行:

When I set it to <true/>, the system extension starts. I do see some lines like this before I see log lines from the app:

...
2020-05-06 12:23:19.229709+0200 0x51ac2    Default     0x0                  0      0    kernel: DK: IOUserServer(sc.example.MyUserUSBInterfaceDriver-0x100002aad)::exit(CDHash check failed)

这个权利是否应该只反映IOKitPersonalities字典中的内容?

Should this entitlement just reflect what is in the IOKitPersonalities dictionary?

完全取下钥匙后,我得到:

With the key completely removed I get:

...
2020-05-06 12:23:19.229709+0200 0x51ac2    Default     0x0                  0      0    kernel: DK: IOUserServer(sc.example.MyUserUSBInterfaceDriver-0x100002aad)::exit(CDHash check failed)
2020-05-06 12:23:19.253517+0200 0x51ac2    Default     0x0                  0      0    kernel: DK: IOUserServer(sc.example.MyUserUSBInterfaceDriver-0x100002aae)::exit(Entitlements check failed)

...所以我猜钥匙一定在那里.

.. so I guess the key must be there.

我正在使用 log stream --source | 查看与应用程序相关的日志行grep MyUserUSBInterfaceDriver

推荐答案

更新答案
由于我已经发布了一些基于 USB DriverKit 的驱动程序,我发现在实践中与我最初在答案中陈述的略有不同,尽管我的原始答案与 Apple 的文档相符.

尽管 Apple 在 USB 传输权利的文档中提到了产品 ID 和供应商 ID,但实际上只有供应商 ID 与权利/代码签名目的相关.这意味着,如果您的驱动程序需要支持任意数量的供应商 ID 为 1234 和 2345(十进制!供应商 ID 的通常表示法是十六进制,所以不要忘记先转换!)您需要在您的dex 的权利:

Although Apple mentions both Product ID and Vendor ID in the documentation for the USB transport entitlement, in practice only the vendor ID is relevant for entitlements/code signing purposes. This means that if your driver needs to support any number of USB devices with vendor IDs 1234 and 2345 (Decimal! Usual notation for vendor IDs is hex, so don't forget to convert first!) you will need to include the following in your dext's entitlements:

<key>com.apple.developer.driverkit.transport.usb</key>
<array>
    <dict>
        <key>idVendor</key>
        <integer>1234</integer>
    </dict>
    <dict>
        <key>idVendor</key>
        <integer>2345</integer>
    </dict>
</array>

明确地说,这意味着权利必须是 array 类型 ->字典,即使您只需要支持一个供应商 ID.

To be clear, that means the entitlement must be of the type array -> dictionaries, even if you only need to support one vendor ID.

列出的 idVendor 值也必须由 Apple 嵌入到您的配置文件中,这就是您在申请 DriverKit 权利时必须包含这些值的原因.请注意,该表单仅支持单个供应商 ID,因此如果您需要支持多个供应商 ID,则必须在自由格式文本字段中将它们全部列出.

The idVendor values listed must also be embedded in your provisioning profile by Apple, which is why you must include them when you apply for DriverKit entitlements. Note that the form only supports a single vendor ID, so if you need to support more than one you must list them all in the free-form text field.

这篇关于如何设置`com.apple.developer.driverkit.transport.usb` 权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆