提交 8eb4ddbc 编写于 作者: zyjhandsome's avatar zyjhandsome

Merge branch 'master' of https://gitee.com/openharmony/docs

......@@ -183,7 +183,7 @@ For details about how to obtain the source code of OpenHarmony, see [Source Code
## Hands-On Tutorials
[Samples](https://gitee.com/openharmony/app_samples)
[Samples](https://gitee.com/openharmony/applications_app_samples)
[Codelabs](https://gitee.com/openharmony/codelabs)
......
......@@ -24,7 +24,7 @@ First thing first, familiarize yourself with the two cornerstone frameworks in O
All applications should be developed on top of these frameworks.
Then, equip yourself for developing the key features, with the following guidelines:
- [Common Event and Notification](notification/notification-brief.md)
- [Common Event and Notification](notification/notification-overview.md)
- [Window Manager](windowmanager/window-overview.md)
- [WebGL](webgl/webgl-overview.md)
- [Media](media/audio-overview.md)
......
......@@ -100,7 +100,7 @@ The widget provider development based on the [stage model](stage-model-developme
- [Configuring the Widget Configuration File](#configuring-the-widget-configuration-file): Configure the application configuration file **module.json5** and profile configuration file.
- [Persistently Storing Widget Data](#persistently-storing-widget-data): Perform persistent management on widget information.
- [Persistently Storing Widget Data](#persistently-storing-widget-data): This operation is a form of widget data exchange.
- [Updating Widget Data](#updating-widget-data): Call **updateForm()** to update the information displayed on a widget.
......@@ -597,3 +597,13 @@ The following is an example:
};
```
## Restrictions
To minimize the abuse of **FormExtensionAbility** by third-party applications, the following APIs cannot be invoked in **FormExtensionAbility**:
- @ohos.ability.particleAbility.d.ts
- @ohos.backgroundTaskManager.d.ts
- @ohos.resourceschedule.backgroundTaskManager.d.ts
- @ohos.multimedia.camera.d.ts
- @ohos.multimedia.audio.d.ts
- @ohos.multimedia.media.d.ts
......@@ -1230,7 +1230,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------------- | ---- | ----------------------- |
| info | [AbilityInfo](js-apis-bundle-AbilityInfo.md) | Yes | Ability information. |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. The value **true** means that the ability is enabled, and **false** means the opposite.|
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.|
**Example**
......@@ -1603,7 +1603,7 @@ bundle.getNameForUid(uid, (err, data) => {
## bundle.getAbilityIcon<sup>8+</sup> <sup>deprecated<sup>
> This API is deprecated since API version 9. You are advised to use [bundleManager.getAbilityIcon](js-apis-bundleManager.md#bundlemanagergetabilityicon) instead.
> This API is deprecated since API version 9. You are advised to use [resourceManager.getMediaContent](js-apis-resource-manager.md#getmediacontent9) instead.
getAbilityIcon(bundleName: string, abilityName: string): Promise\<image.PixelMap>;
......@@ -1646,7 +1646,7 @@ bundle.getAbilityIcon(bundleName, abilityName)
## bundle.getAbilityIcon<sup>8+</sup> <sup>deprecated<sup>
> This API is deprecated since API version 9. You are advised to use [bundleManager.getAbilityIcon](js-apis-bundleManager.md#bundlemanagergetabilityicon) instead.
> This API is deprecated since API version 9. You are advised to use [resourceManager.getMediaContent](js-apis-resource-manager.md#getmediacontent9) instead.
getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback\<image.PixelMap>): void;
......
......@@ -9,11 +9,13 @@ This module provides WebGL APIs that correspond to the OpenGL ES 2.0 feature set
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> WebGL complies with the OpenGL protocol and does not support multi-thread calling.
>
> This module can be used only in the JavaScript-compatible web-like development paradigm.
## Invoking Method
Create a **<canvas\>** component in the HML file. The following is an example:
Create a **\<canvas>** component in the HML file. The following is an example:
```html
......@@ -24,7 +26,7 @@ Create a **<canvas\>** component in the HML file. The following is an example:
</div>
```
Obtain the **<canvas\>** component instance in the JS file. The following is an example:
Obtain the **\<canvas>** component instance in the JS file. The following is an example:
```js
......
......@@ -9,11 +9,13 @@ This module provides WebGL APIs that correspond to the OpenGL ES 3.0 feature set
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> WebGL2 complies with the OpenGL protocol and does not support multi-thread calling.
>
> This module can be used only in the JavaScript-compatible web-like development paradigm.
## Invoking Method
Create a **<canvas\>** component in the HML file. The following is an example:
Create a **\<canvas>** component in the HML file. The following is an example:
```html
......@@ -24,7 +26,7 @@ Create a **<canvas\>** component in the HML file. The following is an example:
</div>
```
Obtain the **<canvas\>** component instance in the JS file. The following is an example:
Obtain the **\<canvas>** component instance in the JS file. The following is an example:
```js
......
......@@ -4,6 +4,10 @@
WebGL helps you process graphics at the frontend, for example, drawing color graphics.
> **NOTE**
>
> WebGL can be used only in the JavaScript-compatible web-like development paradigm.
## Available APIs
......@@ -696,6 +700,7 @@ To use WebGL to draw a color triangle (GPU drawing), perform the following steps
}
```
**Figure 2** Effect of clicking the button to draw a color triangle
![en-us_image_0000001192429306](figures/en-us_image_0000001192429306.gif)
......@@ -186,26 +186,26 @@ For details about the adaptation status, see [SIG-Devboard](https://gitee.com/op
| Subsystem| Sample| Introduction| Programming Language|
| -------- | -------- | -------- | -------- |
| ArkUI | [MouseEvent](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/MouseEvent) | This sample simulates a minesweeper game that calls mouse event-related APIs.| eTS |
| ArkUI | [Vibrator](https://gitee.com/openharmony/applications_app_samples/tree/master/device/Vibrator) | This sample simulates the countdown scenario to show the use of the vibrator APIs.| eTS |
| DFX | [FaultLogger](https://gitee.com/openharmony/applications_app_samples/tree/master/DFX/FaultLogger) | This sample illustrates how to obtain fault information of an application in eTS.| eTS |
| ArkUI | [Vibrator](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/DeviceManagement/Vibrator) | This sample simulates the countdown scenario to show the use of the vibrator APIs.| eTS |
| DFX | [FaultLogger](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/DFX/FaultLogger) | This sample illustrates how to obtain fault information of an application in eTS.| eTS |
| ArkUI | [Gallery](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Gallery) | This sample demonstrates the functions of different components such as universal events, universal attributes, and gestures.| eTS |
| Graphics| [JsWebGL](https://gitee.com/openharmony/applications_app_samples/tree/master/Graphics/JsWebGL) | This sample shows how to use WebGL APIs to draw pentagrams and rectangles by invoking GPU resources.| JS |
| ArkUI | [Clock](https://gitee.com/openharmony/applications_app_samples/tree/master/Preset/Clock) | This sample exemplifies how to implement a simple clock application using the eTS UI capability.| eTS |
| Network management| [Http](https://gitee.com/openharmony/applications_app_samples/tree/master/Network/Http) | This sample simulates Postman, which requires the input of an API address and outputs the data obtained, to show the use of the data request APIs.| eTS |
| ArkUI | [Clock](https://gitee.com/openharmony/applications_app_samples/tree/master/code/Solutions/Tools/ArkTSClock) | This sample exemplifies how to implement a simple clock application using the eTS UI capability.| eTS |
| Network management| [Http](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/Connectivity/Http) | This sample simulates Postman, which requires the input of an API address and outputs the data obtained, to show the use of the data request APIs.| eTS |
| Network management| [Socket](https://gitee.com/openharmony/applications_app_samples/tree/master/Network/Socket) | This sample demonstrates the application of Socket in network communication, including connection authentication and chat communication between two devices.| eTS |
| Distributed data management| [DistributedRdb](https://gitee.com/openharmony/applications_app_samples/tree/master/data/DistributedRdb) | This sample shows how to add, delete, modify, query, and synchronize data in the distributed relational database with eTS.| eTS |
| Ability| [BackgroundTaskManager](https://gitee.com/openharmony/applications_app_samples/tree/master/ResourcesSchedule/BackgroundTaskManager) | This sample simulates the download function. Being processed by the background task management, a download task can continue after the application exits. It stops until the download is complete.| eTS |
| Ability| [BringApp](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/BringApp) | This sample uses the **FeatureAbility** APIs to start a system application based on the application's bundle name and ability name.| eTS |
| Media| [VideoPlayer](https://gitee.com/openharmony/applications_app_samples/tree/master/media/VideoPlayer) | This sample shows how to play a video using the **VideoPlayer** APIs in eTS. It also provides an ability that can be invoked by other applications to play the video.| eTS |
| Ability| [DistributeCalc](https://gitee.com/openharmony/applications_app_samples/tree/master/Preset/DistributeCalc) | This sample implements a simple calculator application using JS distributed features. The calculator can perform simple numerical calculations and start a remote calculator FA to perform collaborative calculation.| eTS |
| Web | [Browser](https://gitee.com/openharmony/applications_app_samples/tree/master/device/Browser) | This sample uses the stage model and related APIs to show a simple browser.| eTS |
| Ability| [DeviceUsageStatistics](https://gitee.com/openharmony/applications_app_samples/tree/master/device/DeviceUsageStatistics) | This sample shows the device usage statistics.| eTS |
| ArkUI | [AdaptiveCapabilities](https://gitee.com/openharmony/applications_app_samples/tree/master/MultiDeviceAppDev/AdaptiveCapabilities) | This sample shows multi-device adaptation in eTS, including resource qualifiers, atomic layouts, and responsive layouts.| eTS |
| ArkUI | [Game2048](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Game2048) | This sample shows how to develop a 2048 game using the **\<Grid>** component.| eTS |
| Window Manager| [Window](https://gitee.com/openharmony/applications_app_samples/tree/master/Graphics/Window) | This sample shows how to create a window, display an application over another application in the form of a floating window, and display an application on split screens.| eTS |
| Distributed data management| [Preference](https://gitee.com/openharmony/applications_app_samples/tree/master/data/Preferences) | This sample shows the theme switching function of preferences.| eTS |
| Distributed data management| [DistributedRdb](https://gitee.com/openharmony/applications_app_samples/tree/master/code/SuperFeature/DistributedAppDev/DistributedRdb) | This sample shows how to add, delete, modify, query, and synchronize data in the distributed relational database with eTS.| eTS |
| Ability| [BackgroundTaskManager](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/TaskManagement/WorkScheduler) | This sample simulates the download function. Being processed by the background task management, a download task can continue after the application exits. It stops until the download is complete.| eTS |
| Ability| [BringApp](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/ApplicationModels/AbilityStartMode) | This sample uses the **FeatureAbility** APIs to start a system application based on the application's bundle name and ability name.| eTS |
| Media| [VideoPlayer](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/FileManagement/MediaCollections) | This sample shows how to play a video using the **VideoPlayer** APIs in eTS. It also provides an ability that can be invoked by other applications to play the video.| eTS |
| Ability| [DistributeCalc](https://gitee.com/openharmony/applications_app_samples/tree/master/code/SuperFeature/DistributedAppDev/ArkTSDistributedCalc) | This sample implements a simple calculator application using JS distributed features. The calculator can perform simple numerical calculations and start a remote calculator FA to perform collaborative calculation.| eTS |
| Web | [Browser](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/Web/Browser) | This sample uses the stage model and related APIs to show a simple browser.| eTS |
| Ability| [DeviceUsageStatistics](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/DeviceUsageStatistics/DeviceUsageStatistics) | This sample shows the device usage statistics.| eTS |
| ArkUI | [AdaptiveCapabilities](https://gitee.com/openharmony/applications_app_samples/tree/master/code/SuperFeature/MultiDeviceAppDev/AdaptiveCapabilities) | This sample shows multi-device adaptation in eTS, including resource qualifiers, atomic layouts, and responsive layouts.| eTS |
| ArkUI | [Game2048](https://gitee.com/openharmony/applications_app_samples/tree/master/code/Solutions/Game/Game2048) | This sample shows how to develop a 2048 game using the **\<Grid>** component.| eTS |
| Window Manager| [Window](https://gitee.com/openharmony/applications_app_samples/tree/master/code/SuperFeature/MultiDeviceAppDev/Settings) | This sample shows how to create a window, display an application over another application in the form of a floating window, and display an application on split screens.| eTS |
| Distributed data management| [Preference](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/DataManagement/Preferences) | This sample shows the theme switching function of preferences.| eTS |
| ArkUI | [NativeAPI](https://gitee.com/openharmony/app_samples/tree/master/Native/NativeAPI) | This sample shows how to call C++ APIs in eTS and how C++ APIs call back JS APIs to play the Gomoku game. The native APIs implement the calculation logic, and eTS implements UI rendering and re-rendering.| eTS/C++ |
| Globalization| [International](https://gitee.com/openharmony/applications_app_samples/tree/master/common/International) | This sample shows how to use APIs related to i18n, intl, and resourceManager in eTS to set the system language, region, time, and time zone. It also provides locale setting examples.| eTS |
| Globalization| [International](https://gitee.com/openharmony/applications_app_samples/tree/master/code/SystemFeature/Internationalnation/International) | This sample shows how to use APIs related to i18n, intl, and resourceManager in eTS to set the system language, region, time, and time zone. It also provides locale setting examples.| eTS |
For more information, visit [Samples](https://gitee.com/openharmony/applications_app_samples).
......
......@@ -191,7 +191,7 @@ For details about the adaptation status, see [SIG-Devboard](https://gitee.com/op
| ArkUI | AdaptiveCapabilities | This sample shows multi-device adaptation in eTS, including resource qualifiers, atomic layouts, and responsive layouts.| eTS |
| ArkUI | JsAdaptiveCapabilities | This sample shows multi-device adaptation in JS, including resource qualifiers, atomic layouts, and responsive layouts.| JS |
For more information, visit [Samples](https://gitee.com/openharmony/app_samples).
For more information, visit [Samples](https://gitee.com/openharmony/applications_app_samples).
## Resolved Issues
......
......@@ -190,15 +190,15 @@ For details about the adaptation status, see [SIG-Devboard](https://gitee.com/op
| Subsystem| Name| Introduction| Programming Language|
| -------- | -------- | -------- | -------- |
| ArkUI development framework| [HealthyDiet](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/HealthyDiet)| This sample app helps you keep food records and view food information. After you add food records, including the food type, weight, and meal time, the app can calculate nutrition data (calories, proteins, fats, and carbon water) for the meals and display the data in a bar chart.| eTS |
| ArkUI development framework| [MusicAlbum](https://gitee.com/openharmony/applications_app_samples/tree/master/MultiDeviceAppDev/MusicAlbum)| This sample shows the home page of a music album app. The adaptive layout and responsive layout are used to ensure that the app can be properly displayed on devices irrespective of screen sizes.| eTS |
| Ability framework and file management subsystem| [Share](https://gitee.com/openharmony/applications_app_samples/tree/master/Share/CustomShare)| Using this sample app, you can share texts, links, and images with third-party applications and display them in these applications.| eTS |
| ArkUI development framework| [HealthyDiet](https://gitee.com/openharmony/applications_app_samples/tree/master/code/SuperFeature/MultiDeviceAppDev/HealthyDiet)| This sample app helps you keep food records and view food information. After you add food records, including the food type, weight, and meal time, the app can calculate nutrition data (calories, proteins, fats, and carbon water) for the meals and display the data in a bar chart.| eTS |
| ArkUI development framework| [MusicAlbum](https://gitee.com/openharmony/applications_app_samples/tree/master/code/SuperFeature/MultiDeviceAppDev/MusicAlbum)| This sample shows the home page of a music album app. The adaptive layout and responsive layout are used to ensure that the app can be properly displayed on devices irrespective of screen sizes.| eTS |
| Ability framework and file management subsystem| [Share](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/ApplicationModels/CustomShare)| Using this sample app, you can share texts, links, and images with third-party applications and display them in these applications.| eTS |
| Ability framework| [GalleryForm](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/GalleryForm)| This sample demonstrates the display of **Gallery** images in a widget and periodic update of the widget.| eTS |
| ArkUI development framework| [AppMarket](https://gitee.com/openharmony/applications_app_samples/tree/master/MultiDeviceAppDev/AppMarket)| This sample shows the home page of an application market, which contains the tab bar, banner, featured apps, and featured games.| eTS |
| ArkUI development framework| [Weather](https://gitee.com/openharmony/applications_app_samples/tree/master/MultiDeviceAppDev/Weather)| This sample demonstrates one-time development for multi-device deployment by showing how to develop a weather app and deploy it across different devices. The demo app includes the following: home page, **Manage City** page, **Add City** page, and **Update Time** page.| eTS |
| Multimedia subsystem| [MediaCollections](https://gitee.com/openharmony/applications_app_samples/tree/master/media/MediaCollections)| This sample shows the capabilities of online streaming, audio and video playback control, and volume adjustment.| eTS |
| ArkUI development framework| [AppMarket](https://gitee.com/openharmony/applications_app_samples/tree/master/code/SuperFeature/MultiDeviceAppDev/AppMarket)| This sample shows the home page of an application market, which contains the tab bar, banner, featured apps, and featured games.| eTS |
| ArkUI development framework| [Weather](https://gitee.com/openharmony/applications_app_samples/tree/master/code/SuperFeature/MultiDeviceAppDev/Weather)| This sample demonstrates one-time development for multi-device deployment by showing how to develop a weather app and deploy it across different devices. The demo app includes the following: home page, **Manage City** page, **Add City** page, and **Update Time** page.| eTS |
| Multimedia subsystem| [MediaCollections](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/FileManagement/MediaCollections)| This sample shows the capabilities of online streaming, audio and video playback control, and volume adjustment.| eTS |
For more information, visit [Samples](https://gitee.com/openharmony/app_samples).
For more information, visit [Samples](https://gitee.com/openharmony/applications_app_samples).
## Resolved Issues
......
......@@ -203,17 +203,16 @@ The following samples written in ArkTS are added.
| Subsystem<div style="width:100px"></div>| Name| Introduction|
| -------- | -------- | -------- |
| Common event and notification subsystem| [Event Notification](https://gitee.com/openharmony/applications_app_samples/tree/master/Notification/CustomEmitter)| This sample shows the in-process event notification. After a user selects an offering and submits an order, the selected offering is displayed in the order list.|
| Data management subsystem| [Cross-Application Data Sharing](https://gitee.com/openharmony/applications_app_samples/tree/master/data/CrossAppDataShare)| This sample implements cross-application data sharing. It provides contacts (data provider) and contacts assistant (data user). Contacts support functionalities such as adding, deleting, modifying, and querying contacts data. Contacts assistant supports contacts data synchronization and merging of duplicate data.|
| Multimedia subsystem| [Background Music Playback](https://gitee.com/openharmony/applications_app_samples/tree/master/ResourcesSchedule/PlayMusicBackground)| This sample implements the request for a continuous task to continue music playback in the background. It is based on the stage model.|
| Resource scheduler subsystem| [Agent-Powered Scheduled Reminder](https://gitee.com/openharmony/applications_app_samples/tree/master/ResourcesSchedule/ReminderAgentManager)| This sample uses agent-powered scheduled reminder to create three types of scheduled reminders: alarm clocks, calendar events, and countdown timers. Agent-powered scheduled reminder ensures that the timing and pop-up notification functions will be performed by the system service agent in the background when the application is frozen or exits.|
| File management subsystem| [Storage Space Statistics](https://gitee.com/openharmony/applications_app_samples/tree/master/FileManager/StorageStatistic)| This sample uses the application package management, application space statistics, and volume management modules to implement the viewing of storage space information of the current device, all installed applications, and all available volumes.|
| Window manager| [Screenshot](https://gitee.com/openharmony/applications_app_samples/tree/master/Graphics/Screenshot)| This sample uses the screenshot, window, and display modules to take screenshots, switch the privacy window, and query the privacy window, in sequence.|
| Bundle management framework| [Multi-HAP](https://gitee.com/openharmony/applications_app_samples/tree/master/bundle/MultiHap)| This sample shows the development of multi-HAP. The sample app includes one entry HAP and two feature HAPs. The two feature HAPs provide audio and video playback components, respectively. The two components are also used in the entry component.|
| Ability framework| [Ability Launch Mode](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/AbilityStartMode)| This sample shows how to implement the standard, singleton, and specified ability launch modes in the stage model.|
| Resource management| [Application Theme Switch](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/ApplicationThemeSwitch)| This sample creates the **dark** and **light** folders at the same level as the **base** folder to configure resources related to the dark and light themes. The custom theme file is configured in the **ThemeConst** file to implement multi-theme switching by controlling variables.|
For more information, visit [Samples](https://gitee.com/openharmony/app_samples).
| Common event and notification subsystem| [Event Notification](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/Notification/CustomEmitter)| This sample shows the in-process event notification. After a user selects an offering and submits an order, the selected offering is displayed in the order list.|
| Data management subsystem| [Cross-Application Data Sharing](https://gitee.com/openharmony/applications_app_samples/tree/master/code/SystemFeature/DataManagement/CrossAppDataShare)| This sample implements cross-application data sharing. It provides contacts (data provider) and contacts assistant (data user). Contacts support functionalities such as adding, deleting, modifying, and querying contacts data. Contacts assistant supports contacts data synchronization and merging of duplicate data.|
| Resource scheduler subsystem| [Agent-Powered Scheduled Reminder](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/TaskManagement/ReminderAgentManager)| This sample uses agent-powered scheduled reminder to create three types of scheduled reminders: alarm clocks, calendar events, and countdown timers. Agent-powered scheduled reminder ensures that the timing and pop-up notification functions will be performed by the system service agent in the background when the application is frozen or exits.|
| File management subsystem| [Storage Space Statistics](https://gitee.com/openharmony/applications_app_samples/tree/master/code/SystemFeature/DeviceManagement/StorageStatistic)| This sample uses the application package management, application space statistics, and volume management modules to implement the viewing of storage space information of the current device, all installed applications, and all available volumes.|
| Window manager| [Screenshot](https://gitee.com/openharmony/applications_app_samples/tree/master/code/SystemFeature/Media/Screenshot)| This sample uses the screenshot, window, and display modules to take screenshots, switch the privacy window, and query the privacy window, in sequence.|
| Bundle management framework| [Multi-HAP](https://gitee.com/openharmony/applications_app_samples/tree/master/code/Project/ApplicationHap/MultiHap)| This sample shows the development of multi-HAP. The sample app includes one entry HAP and two feature HAPs. The two feature HAPs provide audio and video playback components, respectively. The two components are also used in the entry component.|
| Ability framework| [Ability Launch Mode](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/ApplicationModels/AbilityStartMode)| This sample shows how to implement the standard, singleton, and specified ability launch modes in the stage model.|
| Resource management| [Application Theme Switch](https://gitee.com/openharmony/applications_app_samples/tree/master/code/Project/ResourceAllocation/ApplicationThemeSwitch)| This sample creates the **dark** and **light** folders at the same level as the **base** folder to configure resources related to the dark and light themes. The custom theme file is configured in the **ThemeConst** file to implement multi-theme switching by controlling variables.|
For more information, visit [Samples](https://gitee.com/openharmony/applications_app_samples).
......
# Ability Subsystem Changelog
## cl.ability.1 RestartFlag Attribute Names Changed and Unsupported Attribute Deleted in appRecovery
In the **appRecovery** API, the enum names of **RestartFlag** are changed from **NO_RESTART** upon a specific fault to **RESTART** upon a specific fault.
The **CPP_CRASH_NO_RESTART** enum is deleted.
**Change Impact**
If your application uses the **CPP_CRASH_NO_RESTART**, **JS_CRASH_NO_RESTART**, or **APP_FREEZE_NO_RESTART** attribute in versions earlier than 3.2.10.6, its behavior will change after an upgrade to 3.2.10.6.
**Key API/Component Changes**
**RestartFlag** <sup>9+</sup>
Before change:
| Name | Value | Description |
| ----------------------------- | ---- | ------------------------------------------------------------ |
| ALWAYS_RESTART | 0 | The application is restarted in all cases.|
| CPP_CRASH_NO_RESTART | 0x0001 | The application is **not restarted** in the case of CPP_CRASH.|
| JS_CRASH_NO_RESTART | 0x0002 | The application is **not restarted** in the case of JS_CRASH.|
| APP_FREEZE_NO_RESTART | 0x0004 | The application is **not restarted** in the case of APP_FREEZE.|
| NO_RESTART | 0xFFFF | The application is not restarted in any case.|
After change:
| Name | Value | Description |
| ---------- | ---- | ---------- |
| ALWAYS_RESTART | 0 | The application is restarted in all cases.|
| CPP_CRASH_NO_RESTART | NA | **Deleted.** The restart in this scenario is not supported.|
| RESTART_WHEN_JS_CRASH | 0x0001 | The application is **restarted** in the case of JS_CRASH.|
| RESTART_WHEN_APP_FREEZE | 0x0002 | The application is **restarted** in the case of APP_FREEZE.|
| NO_RESTART | 0xFFFF | The application is not restarted in any case.|
**Adaptation Guide**
Perform adaptation based on the new semantics.
# Bundle Manager Subsystem Changelog
## cl.bundlemanager.1 Deleted getAbilityIcon
The **getAbilityIcon** API in [@ohos.bundle.bundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts) is deleted. The **getMediaContent** API in [@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts) can be used instead.
**Change Impact**<br>
The **getAbilityIcon** API does not take effect.
**Key API/Component Changes**<br>
The **getAbilityIcon** API is deleted from **@ohos.bundle.bundleManager.d.ts**.
**Adaptation Guide**<br>
If your application uses **getAbilityIcon** in **@ohos.bundle.bundleManager.d.ts**, replace it with **getMediaContent** in **@ohos.resourceManager.d.ts**. You need to obtain the icon ID in advance. For details, see [Usage Guide](../../../application-dev/reference/apis/js-apis-resource-manager.md#getmediacontent9).
## cl.bundlemanager.2 Bottom-Layer Capability Changed So That Only the System Resource HAP Supports Custom Permissions
Only the system resource HAP supports custom permissions. During HAP parsing, the bundle manager module parses the **definePermissions** field only in the configuration file of the resource HAP (bundle name: **ohos.global.systemres**), but not this field in other HAPs. This field is used to define permissions.
If an application requires custom permissions, add the permissions under the **definePermissions** field in the [configuration file](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json) of the system resource HAP. For details about the permission format, see [Defining Permissions](../../../application-dev/quick-start/module-structure.md#internal-structure-of-the-definepermissions-attribute).
**Change Impact**<br>
After an upgrade to the new version image, the custom permission of the application does not take effect, and the authorization fails.
**Key API/Component Changes**<br>
The bottom-layer capability of the bundle manager module is changed. Only the system resource HAP supports custom permissions.
**Adaptation Guide**<br>
If an application requires custom permissions, add the permissions under the **definePermissions** field in the [configuration file](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json) of the system resource HAP. For details about the permission format, see [Defining Permissions](../../../application-dev/quick-start/module-structure.md#internal-structure-of-the-definepermissions-attribute).
## cl.bundlemanager.3 Level-2 Module File Names Changed
The level-2 module file names of the bundle manager module are changed to their respective API names in the file, as listed below.
| Original File Name|New File Name|
|----|----|
| bundleManager/abilityInfo.d.ts | bundleManager/AbilityInfo.d.ts |
| bundleManager/applicationInfo.d.ts | bundleManager/ApplicationInfo.d.ts |
| bundleManager/bundleInfo.d.ts | bundleManager/BundleInfo.d.ts |
| bundleManager/dispatchInfo.d.ts | bundleManager/DispatchInfo.d.ts |
| bundleManager/elementName.d.ts | bundleManager/ElementName.d.ts |
| bundleManager/extensionAbilityInfo.d.ts | bundleManager/ExtensionAbilityInfo.d.ts |
| bundleManager/hapModuleInfo.d.ts | bundleManager/HapModuleInfo.d.ts |
| bundleManager/launcherAbilityInfo.d.ts | bundleManager/LauncherAbilityInfo.d.ts |
| bundleManager/metadata.d.ts | bundleManager/Metadata.d.ts |
| bundleManager/packInfo.d.ts | bundleManager/BundlePackInfo.d.ts |
| bundleManager/permissionDef.d.ts | bundleManager/PermissionDef.d.ts |
| bundleManager/remoteAbilityInfo.d.ts | bundleManager/RemoteAbilityInfo.d.ts |
| bundleManager/shortcutInfo.d.ts | bundleManager/ShortcutInfo.d.ts |
To sum up, except **packInfo**, which is changed to **BundlePackInfo**, the other file names are changed to start with uppercase letters.
**Change Impact**<br>
The change of the level-2 module file names does not affect the use of the level-1 module. If a level-2 module interface under **bundleManager** is directly imported to the .ts file and an error is reported during compilation on DevEco Studio, you must change the name of the imported file.
**Key API/Component Changes**<br>
The .d.ts file names in the **bundleManager** folder are changed to their respective API names in the file.
**Adaptation Guide**<br>
Generally, no adaptation is required. If a file in the **bundleManager** folder is directly imported to the application, you must change the imported file name as follows:
**Before change:**
```ts
import {AbilityInfo} from 'bundleManger/abilityInfo';
import {ExtensionAbilityInfo} from 'bundleManger/extensionAbilityInfo';
import {BundlePackInfo} from 'bundleManger/packInfo';
```
**After change:**
```ts
import {AbilityInfo} from 'bundleManger/AbilityInfo';
import {ExtensionAbilityInfo} from 'bundleManger/ExtensionAbilityInfo';
import {BundlePackInfo} from 'bundleManger/BundlePackInfo';
```
## cl.bundlemanager.4 LaunchType Enum Type Name Changed from STANDARD to MULTITON
The enum type name of [LaunchType](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts) is changed from **STANDARD** to **MULTITON**. The enum value remains unchanged, indicating the multi-instance type.
**Change Impact**<br>
The **LaunchType.STANDARD** type does not take effect.
**Key API/Component Changes**<br>
The enum type name of **LaunchType** is changed from **STANDARD** to **MULTITON**.
**Adaptation Guide**<br>
Change **LaunchType.STANDARD** to **LaunchType.MULTITON** for your application.
## cl.bundlemanager.5 Changed the isVisible Field in the AbilityInfo Struct to exported
The **isVisible** field in the [AbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities.
**Change Impact**<br>
The **isVisible** field does not take effect.
**Key API/Component Changes**<br>
The **isVisible** field in the [AbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts) struct is changed to **exported**, and the type remains unchanged.
**Adaptation Guide**<br>
Change **isVisible** to **exported** for your application.
## cl.bundlemanager.6 Changed the isVisible Field in the ExtensionAbilityInfo Struct to exported
The **isVisible** field in the [ExtensionAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities.
**Change Impact**<br>
The **isVisible** field does not take effect.
**Key API/Component Changes**<br>
The **isVisible** field in the [ExtensionAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts) struct is changed to **exported**, and the type remains unchanged.
**Adaptation Guide**<br>
Change **isVisible** to **exported** for your application.
## cl.bundlemanager.7 Changed the visible Field in the ModuleAbilityInfo Struct to exported
The **visible** field in the [ModuleAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundlePackInfo.d.ts) struct is changed to **exported**. The type remains unchanged, indicating whether the ability can be exported and used by other abilities.
**Change Impact**<br>
The **visible** field does not take effect.
**Key API/Component Changes**<br>
The **visible** field in the [ModuleAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundlePackInfo.d.ts) struct is changed to **exported**, and the type remains unchanged.
**Adaptation Guide**<br>
Change **visible** to **exported** for your application.
## cl.bundlemanager.8 Deleted the distributedNotificationEnabled Tag from the app.json Configuration File
The [distributedNotificationEnabled](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.9 Deleted the entityType Tag from the app.json Configuration File
The [entityType](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.10 Deleted the keepAlive Tag from the app.json Configuration File
The [keepAlive](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.11 Deleted the removable Tag from the app.json Configuration File
The [removable](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.12 Deleted the singleton Tag from the app.json Configuration File
The [singleton](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.13 Deleted the userDataClearable Tag from the app.json Configuration File
The [userDataClearable](../../../application-dev/quick-start/app-configuration-file.md) tag is deleted from the **app.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.14 No Longer Chinese Characters for the name Tag under module in the module.json Configuration File
The value of [name](../../../application-dev/quick-start/module-configuration-file.md) under **module** in the **module.json** configuration file does not support Chinese characters.
**Change Impact**<br>
If the tag is set to Chinese, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Set this tag to English.
## cl.bundlemanager.15 No Longer Chinese Characters for the name Tag under ability in the module.json Configuration File
The value of [name](../../../application-dev/quick-start/module-configuration-file.md) under **ability** in the **module.json** configuration file does not support Chinese characters.
**Change Impact**<br>
If the tag is set to Chinese, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Set this tag to English.
## cl.bundlemanager.16 Deleted the uiSyntax Tag from the module.json Configuration File
The [uiSyntax](../../../application-dev/quick-start/module-configuration-file.md) tag is deleted from the **module.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.17 Changed srcEntrance to srcEntry in the module.json Configuration File
The [srcEntrance](../../../application-dev/quick-start/module-configuration-file.md) tag under **module** and **ability** in the **module.json** configuration file is changed to **srcEntry**.
**Change Impact**<br>
If the **srcEntrance** tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Replace the **srcEntrance** tag with **srcEntry** in the configuration file.
## cl.bundlemanager.18 Deleted the apiVersion Tag Under distroFilter from the module.json Configuration File
The **apiVersion** tag under [distroFilter](../../../application-dev/quick-start/module-configuration-file.md) is deleted from the **module.json** configuration file.
**Change Impact**<br>
If this tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Delete this tag from the configuration file.
## cl.bundlemanager.19 Changed distroFilter to distributionFilter in the module.json Configuration File
The [distroFilter](../../../application-dev/quick-start/module-configuration-file.md) tag in the **module.json** configuration file is changed to **distributionFilter**.
**Change Impact**<br>
If the **distroFilter** tag is used, an error is reported during compilation on DevEco Studio.
**Adaptation Guide**<br>
Replace **distroFilter** with **distributionFilter** in the configuration file.
......@@ -19,6 +19,10 @@
- [多HAP使用规则](multi-hap-rules.md)
- [多HAP运行机制及数据通信方式](multi-hap-principles.md)
- [应用程序包安装和卸载流程](application-package-install-uninstall.md)
- [应用程序包更新流程](application-package-update.md)
- 应用程序包快速修复
- [快速修复概述](quickfix-principles.md)
- [快速修复调试指导](quickfix-debug.md)
- 应用配置文件(Stage模型)
- [应用配置文件概述(Stage模型)](application-configuration-file-overview-stage.md)
- [app.json5配置文件](app-configuration-file.md)
......
# 应用程序包更新流程
OpenHarmony包管理服务提供了应用程序包更新能力,更新方式如下。
1. 应用市场内更新:新版本应用通过应用市场上架后,应用市场通知终端用户该应用有新版本,终端用户可以根据通知到应用市场(客户端)进行应用升级。
2. 应用内检测升级:终端用户启动应用时,应用市场检测到该应用有新版本会通知终端用户,可以到应用市场进行应用的下载更新。
\ No newline at end of file
# 快速修复命令行调试开发指导
当前阶段,OpenHarmony为开发者提供了命令行的调试开发工具可供使用。比如,包名为com.ohos.quickfix的示例应用,版本号为1000000。该应用的当前版本运行中有某问题需要修复,此时,开发者可参考如下指导使用快速修复能力解决应用问题。
## 编写配置文件patch.json
目前DevEco Studio中还不支持patch.json的配置,因此开发者可根据项目需要编写好该文件后,放到的项目任意目录,方便后续打包工具能够找到该文件即可。在本地新建一个patch.json文件,配置编写示例如下:
```json
{
"app" : {
"bundleName" : "com.ohos.quickfix",
"versionCode" : 1000000, // 应用版本号
"versionName" : "1.0.0.1",
"patchVersionCode" : 1000000, // 补丁版本号
"patchVersionName" : "1.0.0.1"
},
"module" : {
"name" : "entry",
"type" : "patch",
"deviceTypes" : [
"default",
"tablet"
],
"originalModuleHash" : "11223344556677889900" // 待修复hap包的sha256
}
}
```
## 生成快速修复文件
### 快速修复TS文件的代码
* 在DevEco Studio中修改TS文件后,编译HAP,可以在工程目录下找到对应的abc文件,如`build\default\cache\default\LegacyCompileETS\jsbundle\temporary\pages\index.abc`
### 快速修复C++中的代码
* 在DevEco Studio中编译原C++的代码生成.so文件;修复原C++的代码,编译生成新的.so文件。可以在工程目录中找到该so,如`build\default\intermediates\libs\default\arm64-v8a\libentry.so`
* 在本地OpenHarmony SDK路径的`toolchains`文件夹下查看`diff.exe`。通过该工具,基于新.so文件和旧的.so文件,生成.so的快速修复文件,命令如下:
```shell
$ diff.exe -s Example.z.so -d Example.z.so -p Example.z.so.diff
```
命令行参数含义:
- -s:旧so的路径
- -d:新so的路径
- -p:生成的差分文件的路径
## 生成.hqf的快速修复包
基于上述的patch.json、.abc快速修复文件和.so快速修复文件,可以通过本地OpenHarmony SDK路径的`toolchains`文件夹下的`app_packing_tool.jar`生成.hqf包,执行打包命令如下:
```shell
$ java -jar app_packing_tool.jar --mode hqf --json-path patch.json --lib-path libs --ets-patch patchs --out-path entry-default-unsigned.hqf --force true
```
命令行参数介绍:
| 命令 |说明 | 备注|
| --- | --- |---|
| mode |模式 | 必选|
| json-path|patch.json路径|必选|
| lib-path|.so快速修复文件路径,该路径可参考[快速修复包结构](quickfix-principles.md#快速修复包结构)|可选|
| ets-path|.abc快速修复文件路径|可选|
## 快速修复包的签名
签名与hap签名相同,将上述生成的entry-default-unsigned.hqf包,通过[签名工具](../security/hapsigntool-guidelines.md)进行签名。可以使用本地OpenHarmony SDK路径的`toolchains`文件夹下的`hap-sign-tool.jar`,命令如下:
```shell
$ java -jar hap-sign-tool.jar sign-app -keyAlias "OpenHarmony Application Release" -signAlg "SHA256withECDSA" -mode "localSign" -appCertFile "OpenHarmonyApplication.pem" -profileFile "ohos_provision_release.p7b" -inFile "entry-default-unsigned.hqf" -keystoreFile "OpenHarmony.p12" -outFile "entry-signed-release.hqf" -keyPwd "123456" -keystorePwd "123456"
```
## 安装快速修复包
将上述entry-signed-release.hqf包推送到设备上
```shell
hdc.exe file send .\entry-signed-release.hqf /data/
```
在设备上通过下述命令行安装补丁包
```shell
$ bm quickfix -a -f /data/entry-signed-release.hqf
```
快速修复相关完整命令行参考如下:
```
$ bm quickfix -h
usage: bm quickfix <options>
options list:
-h, --help list available commands
-q, --query indicates query quickfix, used with -b or --bundle-name
-b, --bundle-name <bundle-name> query quickfix status and information by a specified bundle name
-a, --apply indicates apply quickfix, used with -f or --file-path
-f, --file-path <file-path> apply a quickfix file by a specified path
-f, --file-path <file-path> <file-path> ... apply some quickfix files of one bundle
-f, --file-path <bundle-direction> apply quickfix files by direction, under which are quickfix files
```
# 快速修复概述
快速修复是OpenHarmony系统提供给开发者的一种技术手段,支持开发者以远快于应用升级的方式对应用程序包进行缺陷修复。和全量应用升级软件版本相比,快速修复的主要优势在小、快和用户体验好。在较短的时间内不中断正在运行的应用的情况下(即不需要重启应用),修复应用的缺陷。
## 快速修复的使用规则
* 仅支持修复应用的TS和C++代码,对应的文件为.abc文件(TS编译后的文件)和.so文件(C++编译后的文件),不支持对资源的修复。
* 不支持新增.abc文件和.so文件。
* 快速修复包部署时要确保对应应用包已安装,如果未安装,则部署失败。
* 快速修复包中配置的包名和应用版本号必须和已安装的包名和版本号应用相同,如果不同则部署失败。
* 如果已经部署过快速修复包,新部署的快速修复包的版本号必须大于之前快速修复包的版本号,否则部署失败。
* 快速修复包的签名信息和待修复的应用的签名信息必须一致,否则会部署失败。
* 新的应用版本发布安装时,会清理掉快速修复包。
## 快速修复包结构
![快速修复包结构](figures/quick_fix_bundle_struct.png)
<br>上图是OpenHarmony应用程序发布的快速修复的包格式
* 从图中可以看出包含两种包格式:
* appqf(Application Quick Fix)
<br> appqf与应用的app pack包是一一对应关系,具体可参考[应用程序包结构](application-package-structure-stage)的介绍。
* appqf包是OpenHarmony应用用于发布到应用市场的单元,不能够直接安装到设备上。
* 它是由一个或多个hqf(Harmony Ability Package Quick Fix)组成,这些hqf包在应用市场会从appqf包中拆分出来,再被分发到具体的设备上。
* appqf包上架到应用市场前要有开发者的签名信息。签名方式可可参考[Hap包签名工具](../security/hapsigntool-overview.md)的介绍。
* hqf(Harmony Ability Package Quick Fix)
<br> hqf包是修复HAP中问题的快速修复包,用于安装到设备上的快速修复单元。一个hqf可以包含.abc的快速修复文件,.so的快速修复文件和描述该包的配置文件。
* `.abc`文件:应用中修改后的ts代码,编译后生成的字节码文件。
* `libs`目录:存放.so库文件的差分文件,以`.so.diff`为后缀。区分的不同的系统cpu架构,例如arm平台、x86平台。
* `patch.json`
<br> 该文件用于描述hqf包版本信息的配置文件,由开发者填写,具体内容如下:
```json
{
"app" : {
"bundleName" : "com.ohos.quickfix",
"versionCode" : 1000000,
"versionName" : "1.0.0",
"patchVersionCode" : 1000000,
"patchVersionName" : "1.0.0"
},
"module" : {
"name" : "entry",
"type" : "patch",
"deviceTypes" : [
"default",
"tablet"
],
"originalModuleHash" : "11223344556677889900"
}
}
```
具体字段说明:
| 字段 |类型 |说明 |备注 |
| --- | --- | --- | --- |
|bundleName | string | 对应应用的包名 | 不可缺省 |
|versionCode | int |对应应用版本号 | 不可缺省 |
|versionName |string |对应应用的版本名称 | patch类型不可缺省 |
|patchVersionCode |int |补丁包的版本号 | 不可缺省 |
|patchVersionName |string |补丁包的版本名称 | patch类型不可缺省 |
|name |string |对应应用的moduleName,用来修复该module的 | 不可缺省 |
|type | string|对应补丁包的类型,当前可选择为patch | 不可缺省 |
|deviceTypes |array<string> |补丁包支持的设备类型 | 不可缺省 |
|originalModuleHash| string |原始module Name对应包的哈希值 | 不可缺省 |
## 快速修复TS编译后的文件
![快速修复生成abc](figures/quick_fix_gen_abc.png)
上图是通过TS代码编译工具生成快速修复.abc文件的流程:
* 原始应用编译时,生成.abc文件和.map文件。.abc是TS代码编译后的字节码文件,应用运行时使用该文件。.map文件是通过TS代码编译工具编译TS代码时生成的中间文件,记录有代码中的函数、类等信息。
* 修复问题后的应用编译时,根据上述的.map文件,结合当前的TS代码,得到差异部分,根据差异部分生成快速修复的.abc文件。该.abc文件也既是最终要放到hqf包中的快速修复文件。
## 快速修复C++编译后的文件
![快速修复差分so生成](figures/quick_fix_gen_so.png)
上图是通过差分工具生成快速修复.so文件的流程:
* 原始应用C++源码通过编译工具生成.so文件,该.so文件供应用在运行时使用。
* 修复问题后的C++源码通过编译工具生成.so文件,该.so文件和原应用的.so文件通过差分工具生成.so快速修复文件,该.so快速修复文件也既是最终要放到hqf包中的快速修复文件。
## 快速修复包的发布部署流程
![快速修复包的发布](figures/quick-fix-devel_release.png)
上图涉及到的模块如下:
* DevEco Studio:用于开发代码的项目工程的集成开发环境。在快速修复的工程中能够给予原应用的代码和修复问题后的代码生成快速修复包,并完成快速修复包的签名。
* 应用市场服务器端:开发者将开发完成的快速修复包上架到该平台,平台会对上架的包进行签名验证、风险扫描和拆包重签名等,然后分发到客户端。
* 应用市场客户端:用于接收应用市场服务器端分发的快速修复包,并触发安装快速修复包。
* 包管理服务:设备上用于管理应用包及快速修复包安装和卸载的系统服务程序。
* 快速修复引擎:设备上用于管理应用切换使用快速修复包的系统服务程序。如果应用正在运行,快速修复引擎接收到有快速修复包部署完成会通知应用切换快速修复包,进而使得应用使能快速修复包。
* 文件系统:应用及快速修复包部署在设备上的位置。
上图是快速修复包的端到端发布部署流程:
1. 开发者通过DevEco Studio,基于原应用的源码和修复后的源码编译打包生成快速修复包,并通过DevEco Studio完成快速修复包的签名。
2. 将生成的带有签名的快速修复包上架到应用市场,应用市场通过验证签名、风险扫描和拆包重签名后进行分发。
3. 设备侧的应用市场客户端检测到应用市场服务器端有新上架的快速修复包会下载最新版本的快速修复包,接着通过系统中的包管理服务来安装部署快速修复包。
4. 快速修复包部署完成后,再由快速修复引擎触发应用使用快速修复包,进而保证用户使用到问题修复后的功能。
## 快速修复包的调试流程
![快速修复包的调试](figures/quick-fix-debug.png)
* DevEco Studio中暂时还没有集成快速修复的能力。当前阶段,OpenHarmony为开发者提供了命令行的调试开发工具可供使用,具体的调试开发流程如下:
1. 基于原应用的源码和修复后的源码,通过命令行工具可以编译生成快速修复包,并通过命令行签名工具完成对快速修复的包的签名。通过命令行调试开发,要对.hqf包签名,并通过命令行工具将.hqf包安装到设备上,.appqf包不能直接安装到设备上。
2. 通过快速修复的命令行工具,将.hqf包安装部署到设备上。
3. .hqf包安装部署完成后,回调通知快速修复引擎触发应用使用快速修复包,进而保证用户使用到问题修复后的功能。
\ No newline at end of file
......@@ -560,6 +560,11 @@ Wi-Fi P2P群组信息已更改。
- 值: usual.event.CHARGING
- 订阅者所需权限: 无
## COMMON_EVENT_CHARGE_TYPE_CHANGED
表示系统充电类型改变的公共事件的动作。仅限系统应用使用。
- 值: usual.event.CHARGE_TYPE_CHANGED
- 订阅者所需权限: 无
## COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED
(预留事件,暂未支持)表示系统空闲模式已更改的公共事件的动作。
- 值: usual.event.DEVICE_IDLE_MODE_CHANGED
......
......@@ -43,7 +43,7 @@ AI业务子系统是OpenHarmony提供原生的分布式AI能力的子系统。
* **语言限制**:C/C++语言
* **操作系统限制**:OpenHarmony操作系统
* **操作系统限制**:OpenHarmony轻量/小型系统
* **AI服务启动的约束与限制**:SAMGR(System Ability Manager)启动且运行正常
......@@ -322,9 +322,7 @@ AI业务子系统是OpenHarmony提供原生的分布式AI能力的子系统。
}
```
4. **sample开发** [(参考唤醒词识别demo)](https://gitee.com/openharmony/applications_sample_camera/tree/master/ai)
位置://applications/sample/camera/ai/asr/keyword\_spotting
4. **sample开发**
**调用Create**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册