• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Updates (OpenHarmony 3.2 Beta2 -> OpenHarmony 3.2 Beta3)
2
3## Bundle Management Framework
4
5The privilege control capability is added for preset applications. The capability can be divided into two parts: permission control for preset applications and configuration of preset applications.
6Application privileges are high-level capabilities of an application, for example, restricting an application from being uninstalled or restricting application data from being deleted.
7OpenHarmony provides both general and device-specific application privileges. The latter can be configured by device vendors for applications on different devices. OpenHarmony supports differentiated configuration of preset applications on different devices. In addition, OpenHarmony provides **GetCfgDirList** for your application to obtain the preset directories, such as **system**, **chipset**, **sys_prod**, and **chip_prod**, in ascending order of priority. For example, the priority of **chip_prod** is higher than that of **system**.
8
9### Changed Installation Mode for Preset Applications
10
11In earlier versions, preset applications are installed by automatically scanning and installing HAP files in the **/system/app** directory. From this version, preset applications are configured based on the trustlist. Specifically, only the HAP file configured with **app-dir** in the **install_list.json** file can be automatically installed as a preset application.
12
13**Change Impacts**
14
15JS and native APIs are not involved, and application development is not affected.
16
17**Key API/Component Changes**
18
19N/A
20
21**Adaptation Guide**
22
23Configure related fields in the [/system/etc/app/install_list.json](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/install_list.json) file. The **app_dir** field specifies the directory where the HAP file is located, and **removable** specifies whether the HAP file can be uninstalled after being installed.
24
25Example:
26
27```json
28{
29    "install_list" : [
30        {
31            "app_dir" : "/system/app/com.ohos.systemui",
32            "removable" : false
33        },
34        {
35            "app_dir" : "/system/app/demo.hap",
36            "removable" : true
37        }
38    ]
39}
40```
41
42### Changes in General Application Privilege Control
43
44For a specific application, the general application privileges remain unchanged on all types of devices. The general application privileges are as follows:
45| Permission| Description                                                      |
46| ---------------- | ------------------------------------------------------------ |
47| AllowAppDataNotCleared | Allows application data to be deleted.|
48| AllowAppMultiProcess | Allows the application to run on multiple processes.|
49| AllowAppDesktopIconHide | Allows the application icon to be hidden from the home screen.|
50| AllowAbilityPriorityQueried | Allows an ability to configure and query the priority.    |
51| AllowAbilityExcludeFromMissions | Allows an ability to be hidden in the mission stack.|
52| AllowAppUsePrivilegeExtension | Allows the application to use Service Extension and Data Extension abilities.|
53| AllowFormVisibleNotify | Allows a widget to be visible on the home screen.|
54
55In earlier versions, these privileges are configured in the **config.json** or **module.json** file and distinguished based on the application type (preset or system application). From this version, the privileges are configured based on the signing certificate and preset trustlist.
56
57**Change Impacts**
58
59JS and native APIs are not involved. If your application needs to use any of these privileges, apply for it. For details about how to apply for and configure the privileges, see [Application Privilege Configuration](../device-dev/subsystems/subsys-app-privilege-config-guide.md).
60
61**Key API/Component Changes**
62
63N/A
64
65**Adaptation Guide**
66
67See [Application Privilege Configuration](../device-dev/subsystems/subsys-app-privilege-config-guide.md).
68
69```json
70{
71    "version-name": "1.0.0",
72    ...
73    "bundle-info": {
74        "developer-id": "OpenHarmony",
75        ...
76    },
77    "issuer": "pki_internal",
78    "app-privilege-capabilities": ["AllowAppDataNotCleared", "AllowAppDesktopIconHide"] // The application data cannot be deleted, and the icon can be hidden on the home screen.
79}
80```
81
82### Changes in Device-specific Application Privilege Control
83In addition to general application privileges, device vendors can define device-specific privileges for an application, as described in the table below.
84
85| Permission                 | Type    | Default Value| Description                                             |
86| --------------------- | -------- | ------ | ------------------------------------------------- |
87| removable             | bool     | true   | Allows the application to be uninstalled. This permission takes effect only for preset applications.               |
88| keepAlive             | bool     | false  | Allows the application to remain resident in the background.                                 |
89| singleton             | bool     | false  | Allows the application to be installed for a single user (User 0).                   |
90| allowCommonEvent      | string[] | -      | Allows the application to be started by a static broadcast.                             |
91| associatedWakeUp      | bool     | false  | Allows the application in the FA model to be woken up by an associated application.                     |
92| runningResourcesApply | bool     | false  | Allows the application to request running resources, such as CPU, event notifications, and Bluetooth.|
93
94In earlier versions, these privileges are configured in the **config.json** or **module.json** file and distinguished based on the application type (preset or system application). From this version, the privileges can be configured based on the preset trustlist. For details, see [install_list_capability.json](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/install_list_capability.json).
95
96**Change Impacts**
97
98JS and native APIs are not involved. If your application needs to use any of these privileges, apply for it. For details, see [Configuration Mode](../device-dev/subsystems/subsys-app-privilege-config-guide.md#configuration-mode).
99
100**Key API/Component Changes**
101
102N/A
103
104**Adaptation Guide**
105
106See [Configuration Mode](../device-dev/subsystems/subsys-app-privilege-config-guide.md#configuration-mode).
107
108```json
109{
110    "install_list": [
111        {
112            "bundleName": "com.example.kikakeyboard",
113            "singleton": true, // The application is installed for a single user.
114            "keepAlive": true, // The application remains resident in the background.
115            "runningResourcesApply": true, // The application can apply for running resources such as CPU, event notifications, and Bluetooth.
116            "associatedWakeUp": true, // The application in the FA model can be woken up by an associated application.
117            "app_signature": ["8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC"], // The setting takes effect only when the configured certificate fingerprint is the same as the HAP certificate fingerprint.
118            "allowCommonEvent": ["usual.event.SCREEN_ON", "usual.event.THERMAL_LEVEL_CHANGED"]
119        }
120}
121```
122
123### Fingerprint Verification for Pre-authorization Trustlist
124
125The pre-authorization file [install_list_permissions.json](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/install_list_permissions.json) is moved from **system/etc/permission** to **system/etc/app/** on the development board. The **app_signature** field is added to specify the fingerprint of the HAP file. Multiple fingerprints can be configured. Authorization can be performed only when the fingerprint is matched.
126
127**Change Impacts**
128
129JS and native APIs are not involved. If your application uses pre-authorization, add the fingerprint to the pre-authorization file.
130
131**Key API/Component Changes**
132
133N/A
134
135**Adaptation Guide**
136
137Refer to the following code:
138
139```json
140{
141[
142    {
143        "bundleName" : "com.ohos.screenshot",
144        "app_signature" : ["8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC9F30024B5"],
145        "permissions" : [
146            {
147                "name" : "ohos.permission.MEDIA_LOCATION",
148                "userCancellable" : true
149            },
150            {
151                "name" : "ohos.permission.READ_MEDIA",
152                "userCancellable" : true
153            },
154            {
155                "name" : "ohos.permission.WRITE_MEDIA",
156                "userCancellable" : true
157            }
158        ]
159    }
160}
161```
162
163## ArkUI Development Framework
164
165### Rectified Variable Sharing Issue of the Common Module in Release HAP Mode During Building in the FA Model
166
167Assume that two pages depend on the same object (foodData) of a file. If page A modifies the object, page B obtains the new value when reading the object. This implements object sharing for the common module.
168
169**Change Impacts**
170
171Application compilation is not affected, and no interface adaptation is required.
172
173**Key API/Component Changes**
174
175N/A
176
177### Restrictions on Declaring Multiple Data Types of State Variables
178
179If a **@State**, **@Provide**, **@Link**, or **@Consume** decorated state variable supports multiple data types, they must be all simple data types or references at one time.
180
181Example:
182
183```ts
184@Entry
185@Component
186struct Index {
187  // Incorrect: @State message: string | Resource = 'Hello World'
188  @State message: string = 'Hello World'
189
190  build() {
191    Row() {
192      Column() {
193        Text(`${ this.message }`)
194          .fontSize(50)
195          .fontWeight(FontWeight.Bold)
196      }
197      .width('100%')
198    }
199    .height('100%')
200  }
201}
202```
203
204**Change Impacts**
205
206When the defined state variable type contains both the simple data types and references, an error is reported during compilation.
207
208**Key API/Component Changes**
209
210If the defined state variable type contains both the simple data types and references, change the type to one of them, as shown in the preceding sample code.
211
212## Globalization Subsystem
213
214### Added Validity Verification for Color Values in Color.json
215
216Validity verification is added for color values in the **color.json** file. The verification rules are as follows:
217
218- The hexadecimal color code is used in any of the following formats:
219    - #rgb: red(0-f) green(0-f) blue(0-f)
220    - #argb: transparency(0-f) red(0-f) green(0-f) blue(0-f)
221    - #rrggbb: red(00-ff) green(00-ff) blue(00-ff)
222    - #aarrggbb: transparency(00-ff) red(00-ff) green(00-ff) blue(00-ff)
223- The dollar sign ($) is used to reference resources defined in the application. The format is as follows:
224    - $color:xxx
225
226**Change Impacts**
227
228If the verification rules are not met, an error is reported during compilation.
229
230**Key API/Component Changes**
231
232N/A
233
234