apple_bundle/entitlements/system.rs
1use serde::{Deserialize, Serialize};
2
3/// System
4#[derive(Serialize, Deserialize, Clone, Default, Debug, PartialEq, Eq)]
5pub struct System {
6 /// A Boolean value that indicates whether your app has permission to activate or
7 /// deactivate system extensions.
8 ///
9 /// To add this entitlement to your app, enable the System Extension capability in
10 /// Xcode. Add this entitlement for all system extension types, including
11 /// DriverKit extensions.
12 ///
13 /// ## Availability
14 /// * macOS 10.15+
15 ///
16 /// ## Framework
17 /// * Bundle resources
18 #[serde(
19 rename = "System Extensions",
20 serialize_with = "crate::serialize_option",
21 skip_serializing_if = "Option::is_none"
22 )]
23 pub system_extension: Option<SystemExtensions>,
24 /// A Boolean that indicates whether the app can act as a user’s default mail client.
25 ///
26 /// ## Availability
27 /// * iOS 14.0+
28 ///
29 /// ## Framework
30 /// * Core Services
31 #[serde(
32 rename = "com.apple.developer.mail-client",
33 serialize_with = "crate::serialize_option",
34 skip_serializing_if = "Option::is_none"
35 )]
36 pub mail_client: Option<bool>,
37 /// A Boolean that indicates whether the app can act as the user’s default web
38 /// browser.
39 ///
40 /// ## Availability
41 /// * iOS 14.0+
42 ///
43 /// ## Framework
44 /// * Core Services
45 #[serde(
46 rename = "com.apple.developer.web-browser",
47 serialize_with = "crate::serialize_option",
48 skip_serializing_if = "Option::is_none"
49 )]
50 pub web_browser: Option<bool>,
51}
52
53/// System Extensions
54#[derive(Serialize, Deserialize, Default, Clone, PartialEq, Eq, Debug)]
55pub struct SystemExtensions {
56 /// A Boolean value that indicates whether other development teams may distribute a
57 /// system extension you create.
58 ///
59 /// Add this entitlement to a system extension that you create and sign using your
60 /// development team credentials, but which other development teams distribute in
61 /// their apps. This extension allows a distributing app to have a different team
62 /// ID than the one associated with the system extension. If this entitlement
63 /// isn't present, the team ID of the app and system extension must match.
64 ///
65 /// ## Availability
66 /// * macOS 10.15+
67 ///
68 /// ## Framework
69 /// * System Extensions
70 #[serde(
71 rename = "com.apple.developer.system-extension.redistributable",
72 serialize_with = "crate::serialize_option",
73 skip_serializing_if = "Option::is_none"
74 )]
75 pub system_extension_redistributable: Option<bool>,
76 /// The entitlement required to monitor system events for potentially malicious
77 /// activity.
78 ///
79 /// You must request this entitlement from Apple.
80 /// For information about how to request the entitlement, see System Extensions and
81 /// DriverKit.
82 ///
83 /// If your app or extension lacks this requirement, es_new_client fails with the
84 /// result ES_NEW_CLIENT_RESULT_ERR_NOT_ENTITLED.
85 ///
86 /// ## Availability
87 /// * macOS 10.15+
88 ///
89 /// ## Framework
90 /// * Endpoint Security
91 #[serde(
92 rename = "com.apple.developer.endpoint-security.client",
93 serialize_with = "crate::serialize_option",
94 skip_serializing_if = "Option::is_none"
95 )]
96 pub endpoint_security_client: Option<bool>,
97 /// A Boolean value that indicates whether your extension has permission to run as a
98 /// user-space driver.
99 ///
100 /// Add this entitlement to every DriverKit driver you create.
101 /// You must request this entitlement from Apple.
102 /// For information about how to request the entitlement, see System Extensions and
103 /// DriverKit.
104 ///
105 /// ## Availability
106 /// * macOS 10.15+
107 ///
108 /// ## Framework
109 /// * DriverKit
110 #[serde(
111 rename = "com.apple.developer.driverkit",
112 serialize_with = "crate::serialize_option",
113 skip_serializing_if = "Option::is_none"
114 )]
115 pub driverkit: Option<bool>,
116 /// A Boolean value indicating whether to match the driver against devices that
117 /// communicate using networking protocols.
118 ///
119 /// ## Availability
120 /// * macOS 10.15+
121 ///
122 /// ## Framework
123 /// * DriverKit
124 #[serde(
125 rename = "com.apple.developer.driverkit.family.networking",
126 serialize_with = "crate::serialize_option",
127 skip_serializing_if = "Option::is_none"
128 )]
129 pub driverkit_family_networking: Option<bool>,
130 /// A Boolean value that indicates whether to match the driver against devices with
131 /// SCSI controllers.
132 ///
133 /// Add this entitlement to the default entitlements file that Xcode created for your
134 /// driver project.
135 ///
136 /// ## Availability
137 /// * macOS 11.3+
138 ///
139 /// ## Framework
140 /// * DriverKit
141 #[serde(
142 rename = "com.apple.developer.driverkit.family.scsicontroller",
143 serialize_with = "crate::serialize_option",
144 skip_serializing_if = "Option::is_none"
145 )]
146 pub driverkit_family_scsi_controller: Option<bool>,
147 /// A Boolean value that indicates whether to match the driver against devices with
148 /// serial communication interfaces.
149 ///
150 /// Add this entitlement to the default entitlements file that Xcode created for your
151 /// driver project.
152 ///
153 /// ## Availability
154 /// * macOS 10.15+
155 ///
156 /// ## Framework
157 /// * DriverKit
158 #[serde(
159 rename = "com.apple.developer.driverkit.family.serial",
160 serialize_with = "crate::serialize_option",
161 skip_serializing_if = "Option::is_none"
162 )]
163 pub driverkit_family_serial: Option<bool>,
164 /// An array of PCI device descriptors that your custom driver supports.
165 ///
166 /// Each element in the array is a dictionary whose keys identify a supported device.
167 /// The values of these keys correspond to values stored in the PCI device’s
168 /// configuration registers.
169 ///
170 /// You can provide several matching values for a key, separated by spaces.
171 /// You can also specify an optional mask for the configuration register value by
172 /// putting the mask after the value, prepended with an & character.
173 ///
174 /// Examples:
175 /// * Key = IOPCIMatch. Value = 0x00261011. Result = Matches a device whose vendor ID
176 /// is 0x1011, and device ID is 0x0026, including subsystem IDs.
177 /// * Key = IOPCIMatch. Value = 0x00789004&0x00ffffff 0x78009004&0x0xff00ffff. Result
178 /// = Matches with any device with a vendor ID of 0x9004, and a device ID of 0xzz78
179 /// or 0x78zz, where ‘z’ is any hexadecimal digit.
180 /// * Key = IOPCIClassMatch. Value = 0x02000000&0xffff0000. Result = Matches a device
181 /// whose class code is 0x0200zz (where ‘z’ is any hexadecimal digit), an ethernet
182 /// device.
183 ///
184 /// ### Note
185 /// You also use the keys defined by this entitlement in your app’s Info.plist, to
186 /// identify which devices your driver loads on.
187 ///
188 /// ## Availability
189 /// * macOS 10.15.4+
190 ///
191 /// ## Framework
192 /// * DriverKit
193 #[serde(
194 rename = "com.apple.developer.driverkit.transport.pci",
195 serialize_with = "crate::serialize_option",
196 skip_serializing_if = "Option::is_none"
197 )]
198 pub driverkit_transport_pci: Option<Vec<DriverkitTransportPci>>,
199 /// An array of dictionaries that identify the USB devices the driver supports.
200 ///
201 /// Each element in the array is a dictionary whose keys and values identify a
202 /// specific type of supported device. The keys in the dictionary correspond to
203 /// field names of the device descriptor associated with the USB device.
204 ///
205 /// ## Availability
206 /// * macOS 10.15+
207 ///
208 /// ## Framework
209 /// * DriverKit
210 #[serde(
211 rename = "com.apple.developer.driverkit.transport.usb",
212 serialize_with = "crate::serialize_option",
213 skip_serializing_if = "Option::is_none"
214 )]
215 pub driverkit_transport_usb: Option<Vec<DriverkitTransportUsb>>,
216 /// An array of strings that represent driver extensions which may communicate with
217 /// other DriverKit services.
218 ///
219 /// Add this entitlement to your app that opens the IOUserClient.
220 /// Set its value to an array of bundle IDs of driver extensions that you want to use
221 /// with DriverKit. If you have only one bundle ID, you can use either a single
222 /// string or a one-element array.
223 ///
224 /// ## Availability
225 /// * macOS 10.15+
226 ///
227 /// ## Framework
228 /// * DriverKit
229 #[serde(
230 rename = "com.apple.developer.driverkit.userclient-access",
231 serialize_with = "crate::serialize_option",
232 skip_serializing_if = "Option::is_none"
233 )]
234 pub driverkit_userclient_access: Option<Vec<String>>,
235 /// A Boolean value that indicates whether the driver provides a HID-related service
236 /// to the system.
237 ///
238 /// ## Availability
239 /// * macOS 10.15+
240 ///
241 /// ## Framework
242 /// * HIDDriverKit
243 #[serde(
244 rename = "com.apple.developer.driverkit.family.hid.device",
245 serialize_with = "crate::serialize_option",
246 skip_serializing_if = "Option::is_none"
247 )]
248 pub driverkit_family_hid_device: Option<bool>,
249 /// A Boolean value that indicates whether the driver provides a HID-related event
250 /// service to the system.
251 ///
252 /// ## Availability
253 /// * macOS 10.15+
254 ///
255 /// ## Framework
256 /// * HIDDriverKit
257 #[serde(
258 rename = "com.apple.developer.driverkit.family.hid.eventservice",
259 serialize_with = "crate::serialize_option",
260 skip_serializing_if = "Option::is_none"
261 )]
262 pub driverkit_family_hid_eventservice: Option<bool>,
263 /// A Boolean value that indicates whether the driver communicates with human
264 /// interface devices.
265 ///
266 /// This entitlement gives your driver permission to interact with the hardware for a
267 /// human interface device.
268 ///
269 /// ## Availability
270 /// * macOS 10.15+
271 ///
272 /// ## Framework
273 /// * HIDDriverKit
274 #[serde(
275 rename = "com.apple.developer.driverkit.transport.hid",
276 serialize_with = "crate::serialize_option",
277 skip_serializing_if = "Option::is_none"
278 )]
279 pub driverkit_transport_hid: Option<bool>,
280 /// A Boolean value that indicates whether the driver creates a virtual HID device.
281 ///
282 /// ## Availability
283 /// * macOS 10.15+
284 ///
285 /// ## Framework
286 /// * HIDDriverKit
287 #[serde(
288 rename = "com.apple.developer.hid.virtual.device",
289 serialize_with = "crate::serialize_option",
290 skip_serializing_if = "Option::is_none"
291 )]
292 pub hid_virtual_device: Option<bool>,
293}
294
295/// Driver Kit Transport PCI
296#[derive(Serialize, Deserialize, Default, Clone, PartialEq, Eq, Debug)]
297pub struct DriverkitTransportPci {
298 /// A key to match PCI devices by vendor and device ID registers or subsystem
299 /// registers.
300 ///
301 /// This value of this key matches the vendor and device ID (0x00) register, or the
302 /// subsystem register (0x2c).
303 ///
304 /// ## Availability
305 /// * macOS 10.15.4+
306 ///
307 /// ## Framework
308 /// * DriverKit
309 #[serde(
310 rename = "IOPCIMatch",
311 serialize_with = "crate::serialize_option",
312 skip_serializing_if = "Option::is_none"
313 )]
314 pub pci_match: Option<String>,
315 /// A key to match PCI devices by vendor and device ID registers.
316 ///
317 /// This value of this key matches the vendor and device ID (0x00) register.
318 ///
319 /// ## Availability
320 /// * macOS 10.15.4+
321 ///
322 /// ## Framework
323 /// * DriverKit
324 #[serde(
325 rename = "IOPCIPrimaryMatch",
326 serialize_with = "crate::serialize_option",
327 skip_serializing_if = "Option::is_none"
328 )]
329 pub primary_match: Option<String>,
330 /// A key to match PCI devices by subsystem vendor ID and device ID registers.
331 ///
332 /// This value of this key matches the subsystem register (0x2c).
333 ///
334 /// ## Availability
335 /// * macOS 10.15.4+
336 ///
337 /// ## Framework
338 /// * DriverKit
339 #[serde(
340 rename = "IOPCISecondaryMatch",
341 serialize_with = "crate::serialize_option",
342 skip_serializing_if = "Option::is_none"
343 )]
344 pub secondary_match: Option<String>,
345 /// A key to match PCI devices by class code register.
346 ///
347 /// This value of this key matches the class code register (0x08). The default mask
348 /// for this register is 0xffffff00.
349 ///
350 /// ## Availability
351 /// * macOS 10.15.4+
352 ///
353 /// ## Framework
354 /// * DriverKit
355 #[serde(
356 rename = "IOPCIClassMatch",
357 serialize_with = "crate::serialize_option",
358 skip_serializing_if = "Option::is_none"
359 )]
360 pub class_match: Option<String>,
361}
362
363#[derive(Serialize, Deserialize, Default, Clone, PartialEq, Eq, Debug)]
364pub struct DriverkitTransportUsb {
365 /// ## Availability
366 /// * macOS 10.15+
367 ///
368 /// ## Framework
369 /// * DriverKit
370 #[serde(
371 rename = "bConfigurationValue",
372 serialize_with = "crate::serialize_option",
373 skip_serializing_if = "Option::is_none"
374 )]
375 pub configuration_value: Option<String>,
376 /// ## Availability
377 /// * macOS 10.15+
378 ///
379 /// ## Framework
380 /// * DriverKit
381 #[serde(
382 rename = "bDeviceClass",
383 serialize_with = "crate::serialize_option",
384 skip_serializing_if = "Option::is_none"
385 )]
386 pub device_class: Option<String>,
387 /// ## Availability
388 /// * macOS 10.15+
389 ///
390 /// ## Framework
391 /// * DriverKit
392 #[serde(
393 rename = "bDeviceProtocol",
394 serialize_with = "crate::serialize_option",
395 skip_serializing_if = "Option::is_none"
396 )]
397 pub device_protocol: Option<String>,
398 /// ## Availability
399 /// * macOS 10.15+
400 ///
401 /// ## Framework
402 /// * DriverKit
403 #[serde(
404 rename = "bDeviceSubClass",
405 serialize_with = "crate::serialize_option",
406 skip_serializing_if = "Option::is_none"
407 )]
408 pub device_sub_class: Option<String>,
409 /// ## Availability
410 /// * macOS 10.15+
411 ///
412 /// ## Framework
413 /// * DriverKit
414 #[serde(
415 rename = "bInterfaceClass",
416 serialize_with = "crate::serialize_option",
417 skip_serializing_if = "Option::is_none"
418 )]
419 pub interface_class: Option<String>,
420 /// ## Availability
421 /// * macOS 10.15+
422 ///
423 /// ## Framework
424 /// * DriverKit
425 #[serde(
426 rename = "bInterfaceNumber",
427 serialize_with = "crate::serialize_option",
428 skip_serializing_if = "Option::is_none"
429 )]
430 pub interface_number: Option<String>,
431 /// ## Availability
432 /// * macOS 10.15+
433 ///
434 /// ## Framework
435 /// * DriverKit
436 #[serde(
437 rename = "bInterfaceProtocol",
438 serialize_with = "crate::serialize_option",
439 skip_serializing_if = "Option::is_none"
440 )]
441 pub interface_protocol: Option<String>,
442 /// ## Availability
443 /// * macOS 10.15+
444 ///
445 /// ## Framework
446 /// * DriverKit
447 #[serde(
448 rename = "bInterfaceSubClass",
449 serialize_with = "crate::serialize_option",
450 skip_serializing_if = "Option::is_none"
451 )]
452 pub interface_sub_class: Option<String>,
453 /// ## Availability
454 /// * macOS 10.15+
455 ///
456 /// ## Framework
457 /// * DriverKit
458 #[serde(
459 rename = "bcdDevice",
460 serialize_with = "crate::serialize_option",
461 skip_serializing_if = "Option::is_none"
462 )]
463 pub device: Option<String>,
464 /// ## Availability
465 /// * macOS 10.15+
466 ///
467 /// ## Framework
468 /// * DriverKit
469 #[serde(
470 rename = "idProduct",
471 serialize_with = "crate::serialize_option",
472 skip_serializing_if = "Option::is_none"
473 )]
474 pub product: Option<String>,
475 /// ## Availability
476 /// * macOS 10.15+
477 ///
478 /// ## Framework
479 /// * DriverKit
480 #[serde(
481 rename = "idProductArray",
482 serialize_with = "crate::serialize_option",
483 skip_serializing_if = "Option::is_none"
484 )]
485 pub product_array: Option<String>,
486 /// ## Availability
487 /// * macOS 10.15+
488 ///
489 /// ## Framework
490 /// * DriverKit
491 #[serde(
492 rename = "idProductMask",
493 serialize_with = "crate::serialize_option",
494 skip_serializing_if = "Option::is_none"
495 )]
496 pub product_mask: Option<String>,
497 /// ## Availability
498 /// * macOS 10.15+
499 ///
500 /// ## Framework
501 /// * DriverKit
502 #[serde(
503 rename = "idVendor",
504 serialize_with = "crate::serialize_option",
505 skip_serializing_if = "Option::is_none"
506 )]
507 pub vendor: Option<i32>,
508}