• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Structure of the deviceConfig Tag
2<!--Kit: Ability Kit-->
3<!--Subsystem: BundleManager-->
4<!--Owner: @wanghang904-->
5<!--Designer: @hanfeng6-->
6<!--Tester: @kongjing2-->
7<!--Adviser: @Brilliantry_Rui-->
8
9
10The **deviceConfig** tag contains device-specific configuration of the application, including attributes such as **default**, **tv**, **car**, and **wearable**. The **default** configuration applies to all types of devices. You need to declare the peculiar configuration of a specific device type in the associated sub-tag of this type.
11
12## Internal Structure of the deviceConfig Tag
13
14**Table 1** Internal structure of the deviceConfig tag
15
16| Name| Description| Data Type| Initial Value Allowed|
17| -------- | -------- | -------- | -------- |
18| default | Application configuration that provides full access to system capabilities.| Object| Yes (initial value: left empty)|
19| tablet | Application configuration specific to tablets.| Object| Yes (initial value: left empty)|
20| tv | Application configuration specific to smart TVs.| Object| Yes (initial value: left empty)|
21| car | Application configuration specific to telematics devices.| Object| Yes (initial value: left empty)|
22| wearable | Application configuration specific to wearables.| Object| Yes (initial value: left empty)|
23
24
25For details about the attributes of the **deviceConfig** tag, see [Internal Structure of the deviceConfig Attributes](#internal-structure-of-the-deviceconfig-attributes).
26
27## Internal Structure of the deviceConfig Attributes
28
29**Table 2** Internal structure of the deviceConfig attributes
30
31| Name| Description| Data Type| Initial Value Allowed|
32| -------- | -------- | -------- | -------- |
33| process | Name of the process running the application or ability. If the **process** attribute is configured in the **deviceConfig** tag, all abilities of the application run in this process. You can set the **process** attribute for a specific ability in the **abilities** attribute, so that the ability can run in the particular process. The value can contain a maximum of 31 characters.| String| Yes (initial value: left empty)|
34| keepAlive | Whether the application keeps running. This attribute applies only to system applications and does not take effect for third-party applications.  <br>- **true**: The application keeps running. The system starts the application upon its startup and restarts the application when the application exits.<br>- **false**: The application does not keep running. The system neither starts the application upon its startup nor restarts the application when the application exits.| Boolean| Yes (initial value: **false**)|
35| supportBackup | Whether the application supports backup and restoration.<br>- **true**: Yes<br>- **false**: No| Boolean| Yes (initial value: **false**)|
36| compressNativeLibs | During HAP packaging, whether the **libs** libraries are packaged to HAP after being compressed.<br>- **true**: The **libs** libraries are packaged in the HAP file after being compressed.<br>- **false**: The **libs** libraries are stored without being compressed.<br>During application installation, whether the **libs** library needs to be decompressed. (Since API version 16, this field is supported. In earlier versions, the **libs** library is decompressed by default.)<br>- **true**: The **libs** library is decompressed.<br>- **false**: The **libs** library is not decompressed.| Boolean| Yes (During HAP packaging, initial value: **false**; during application installation, initial value: **true**)|
37| network | Network security configuration. You can customize the network security settings of the application in the security statement of the configuration file without modifying the application code.| Object| Yes (initial value: left empty)|
38
39## Internal Structure of the network Attribute
40
41**Table 3** Internal structure of the network attribute
42
43| Name| Description| Data Type| Initial Value Allowed|
44| -------- | -------- | -------- | -------- |
45| cleartextTraffic | Whether to allow the application to use plaintext traffic, for example, plaintext HTTP traffic.<br>- **true**: The application is allowed to use plaintext traffic.<br>- **false**: The application is not allowed to use plaintext traffic.| Boolean| Yes (initial value: **false**)|
46| securityConfig | Network security configuration of the application.| Object| Yes (initial value: left empty)|
47
48## Internal Structure of the securityConfig Attribute
49
50**Table 4** Internal structure of the securityConfig attribute
51
52| Name| Description| Data Type| Initial Value Allowed|
53| -------- | -------- | -------- | -------- |
54| domainSettings | Security settings of the custom network domain. This attribute allows nested domains. That is, the **domainSettings** object of a network domain can be nested with the **domainSettings** objects of smaller network domains.| Object| Yes (initial value: left empty)|
55
56## Internal Structure of the domainSettings Attribute
57
58**Table 5** Internal structure of the domainSettings attribute
59
60| Name| Description| Data Type| Initial Value Allowed|
61| -------- | -------- | -------- | -------- |
62| cleartextPermitted | Whether cleartext is allowed in the custom network domain. If both **cleartextTraffic** and **securityConfig** exist, the value of **cleartextPermitted** is used.<br>- **true**: Cleartext is allowed.<br>- **false**: Cleartext is not allowed.| Boolean| Yes (initial value: left empty)|
63| domains | Domain name. This attribute consists of two sub-attributes: **subdomains** and **name**.<br>- **subdomains** (boolean): specifies whether the domain name contains subdomains. If it is set to **true**, the domain naming convention applies to all related domains and subdomains (including the lower-level domains of the subdomains). Otherwise, the convention applies only to exact matches.<br>- **name** (string): indicates the domain name.| Object array| Yes (initial value: left empty)|
64
65Example of the **deviceConfig** tag:
66
67```json
68"deviceConfig": {
69  "default": {
70    "process": "com.example.test.example",
71    "supportBackup": false,
72    "network": {
73      "cleartextTraffic": true,
74      "securityConfig": {
75        "domainSettings": {
76          "cleartextPermitted": true,
77          "domains": [
78            {
79              "subdomains": true,
80              "name": "example.ohos.com"
81            }
82          ]
83        }
84      }
85    }
86  }
87}
88```
89