diff --git a/OAT.xml b/OAT.xml index ede23a6b924f7e3a1dca34a3189c2094ef035ca8..cc753a0724b322ecf7aa522ded4db88f1f0318e2 100644 --- a/OAT.xml +++ b/OAT.xml @@ -782,7 +782,17 @@ Note:If the text contains special characters, please escape them according to th - + + + + + + + + + + + diff --git a/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/ability/EntryAbility.ets b/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/ability/EntryAbility.ets index 642d74acd80d7b32d243641d700964ead8a3e968..5f81cef6f1119f9618b46394b405bfa57abbdd6d 100644 --- a/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/ability/EntryAbility.ets +++ b/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/ability/EntryAbility.ets @@ -76,7 +76,7 @@ export default class EntryAbility extends UIAbility { } onSaveState(reason: AbilityConstant.StateType, wantParam: Record): AbilityConstant.OnSaveResult { - Logger.info(TAG, 'onDestroy'); + Logger.info(TAG, 'onSaveState'); let string = this.storage.get('FaultTriggerPageString'); let counter = this.storage.get('FaultTriggerPageCounter'); wantParam['FaultTriggerPageString'] = string ?? 'Empty'; diff --git a/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/pages/FaultTriggerPage.ets b/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/pages/FaultTriggerPage.ets index 57d867fd886b23f5c8c907f85b639be5201cac9b..5d0c57b05cd66bcfccd939f81057604051b041d0 100644 --- a/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/pages/FaultTriggerPage.ets +++ b/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/pages/FaultTriggerPage.ets @@ -61,7 +61,7 @@ struct FaultTriggerPage { .fontSize('30fp') .fontWeight(FontWeight.Bold) .padding({ left: '24vp', right: '24vp', top: '7vp', bottom: '8vp' }) - .margin({ top: '24vp' }) + .margin({ top: '14vp' }) .textAlign(TextAlign.Start) .height('56vp') .width('100%') @@ -309,6 +309,7 @@ struct FaultTriggerPage { .backgroundColor($r('sys.color.ohos_id_color_foreground_contrary')) .padding({ left: '12vp', right: '12vp', top: '4vp', bottom: '4vp' }) .divider({ strokeWidth: '0.5vp', color: $r('app.color.text_grey_opacity') }); - }.backgroundColor($r('sys.color.ohos_id_color_sub_background')).width('100%').height('100%'); + }.backgroundColor($r('sys.color.ohos_id_color_sub_background')).width('100%').height('100%') + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]); } } diff --git a/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/pages/Index.ets b/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/pages/Index.ets index 6b5d3cb12eccb9906636dc8c72bf9a81ce349837..5d0ad7ec9b40c6a496587d8356b6d597f9fa963b 100644 --- a/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/pages/Index.ets +++ b/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/pages/Index.ets @@ -35,7 +35,7 @@ struct FirstPage { .fontSize('30fp') .fontWeight(FontWeight.Bold) .padding({ left: '24vp', right: '24vp', top: '7vp', bottom: '8vp' }) - .margin({ top: '24vp' }) + .margin({ top: '14vp' }) .textAlign(TextAlign.Start) .height('56vp') .width('100%') @@ -84,9 +84,10 @@ struct FirstPage { router.pushUrl({ url: 'pages/FaultTriggerPage' }); }) .width('88.9%') - .margin({ top: '520vp', right: '24vp', left: '24vp', bottom: '24vp' }) + .margin({ top: '480vp', right: '24vp', left: '24vp', bottom: '34vp' }) .height('40vp') .backgroundColor($r('app.color.text_blue_opacity')); - }.backgroundColor($r('sys.color.ohos_id_color_sub_background')).width('100%').height('100%'); + }.backgroundColor($r('sys.color.ohos_id_color_sub_background')).width('100%').height('100%') + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]); } } diff --git a/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/pages/RecoveryPage.ets b/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/pages/RecoveryPage.ets index 94a06d95385cbf63b912e73884f0cbccf127a843..9f4bb4093b7f9614986f1a7b9b3dc7ccf6f7b223 100644 --- a/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/pages/RecoveryPage.ets +++ b/code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/pages/RecoveryPage.ets @@ -37,7 +37,7 @@ struct Index { .fontSize('30fp') .fontWeight(FontWeight.Bold) .padding({ left: '24vp', right: '24vp', top: '4vp', bottom: '4vp' }) - .margin({ top: '24vp' }) + .margin({ top: '14vp' }) .textAlign(TextAlign.Start) .height('56vp') .width('100%') @@ -106,6 +106,7 @@ struct Index { .borderRadius('24vp') .backgroundColor($r('sys.color.ohos_id_color_foreground_contrary')) .padding({ left: '12vp', right: '12vp', top: '4vp', bottom: '4vp' }) - }.backgroundColor($r('sys.color.ohos_id_color_sub_background')).width('100%').height('100%'); + }.backgroundColor($r('sys.color.ohos_id_color_sub_background')).width('100%').height('100%') + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]); } } diff --git a/code/BasicFeature/DFX/AppRecovery/entry/src/main/module.json5 b/code/BasicFeature/DFX/AppRecovery/entry/src/main/module.json5 index a62676c8a0a917df9f16e03bd567509d6334d11a..a096762082fa635a29e2722dde744167fd5a9630 100644 --- a/code/BasicFeature/DFX/AppRecovery/entry/src/main/module.json5 +++ b/code/BasicFeature/DFX/AppRecovery/entry/src/main/module.json5 @@ -18,28 +18,24 @@ "name": "entry", "type": "entry", "description": "$string:module_desc", - "srcEntrance": "./ets/app/MyAbilityStage.ets", + "srcEntry": "./ets/app/MyAbilityStage.ets", "mainElement": "EntryAbility", "deviceTypes": [ "default" ], - "metadata": [ { - "name": "ArkTSPartialUpdate", - "value": "false" - } ], "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", "abilities": [ { "name": "EntryAbility", - "srcEntrance": "./ets/ability/EntryAbility.ets", + "srcEntry": "./ets/ability/EntryAbility.ets", "description": "$string:EntryAbility_desc", "icon": "$media:icon", "label": "$string:EntryAbility_label", "startWindowIcon": "$media:icon", "startWindowBackground": "$color:start_window_background", - "visible": true, + "exported": true, "recoverable": true, "skills": [ { @@ -54,24 +50,24 @@ }, { "name": "SecondAbility", - "srcEntrance": "./ets/ability/SecondAbility.ets", + "srcEntry": "./ets/ability/SecondAbility.ets", "description": "$string:EntryAbility_desc", "icon": "$media:icon", "label": "$string:TextAbility_label", "startWindowIcon": "$media:icon", "startWindowBackground": "$color:start_window_background", - "visible": true, + "exported": true, "recoverable": true }, { "name": "RecoveryAbility", - "srcEntrance": "./ets/ability/RecoveryAbility.ets", + "srcEntry": "./ets/ability/RecoveryAbility.ets", "description": "$string:EntryAbility_desc", "icon": "$media:icon", "label": "$string:RecoveryAbility_label", "startWindowIcon": "$media:icon", "startWindowBackground": "$color:start_window_background", - "visible": true + "exported": true } ] } diff --git a/code/BasicFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/capabilities/StationaryManager.ets b/code/BasicFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/capabilities/StationaryManager.ets index ebe6b3b6874751397471274bc915a47dd59974ac..7d2e783fa68903046c146dab152139028d70b286 100644 --- a/code/BasicFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/capabilities/StationaryManager.ets +++ b/code/BasicFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/capabilities/StationaryManager.ets @@ -47,7 +47,7 @@ export struct StationaryManager { switch (index) { case 0: try { - stationary.on('still', stationary.ActivityEvent.ENTER_EXIT, 3, (data) => { + stationary.on('still', stationary.ActivityEvent.ENTER_EXIT, 1000000000, (data) => { this.result = `on still success:${JSON.stringify(data)}`; }) this.result = ``; diff --git a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/AK47.png b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/AK47.png index 8bed40617b07c305b188e36b209d1b5184c11ede..ce307a8827bd75456441ceb57d530e4c8d45d36c 100644 Binary files a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/AK47.png and b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/AK47.png differ diff --git a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/AssaultRifle.png b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/AssaultRifle.png index 71d1a81b9a10ee3c986c51da959f290f5f397095..ce307a8827bd75456441ceb57d530e4c8d45d36c 100644 Binary files a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/AssaultRifle.png and b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/AssaultRifle.png differ diff --git a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Battle5.png b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Battle5.png index 9c54b2bb02fbb23e7c6b3511173f1dafb94ecf65..ce307a8827bd75456441ceb57d530e4c8d45d36c 100644 Binary files a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Battle5.png and b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Battle5.png differ diff --git a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Battle6.png b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Battle6.png index 47ead0655e19885aa28c92d62f04d610f8a59ae7..ce307a8827bd75456441ceb57d530e4c8d45d36c 100644 Binary files a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Battle6.png and b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Battle6.png differ diff --git a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/CZ75.png b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/CZ75.png index d4cb62341716c3a42319746fbf5cf76ed29ef550..ce307a8827bd75456441ceb57d530e4c8d45d36c 100644 Binary files a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/CZ75.png and b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/CZ75.png differ diff --git a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/HK416.png b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/HK416.png index 49cf90102c18dd47bb5138d0a492278d2c8661e2..ce307a8827bd75456441ceb57d530e4c8d45d36c 100644 Binary files a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/HK416.png and b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/HK416.png differ diff --git a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/M4.png b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/M4.png index d9ded788895475343b11b785ce6ff8a6415aac31..ce307a8827bd75456441ceb57d530e4c8d45d36c 100644 Binary files a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/M4.png and b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/M4.png differ diff --git a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/MP5.png b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/MP5.png index 4b3016f5566a82f472695c07c5a5a72409e56dea..ce307a8827bd75456441ceb57d530e4c8d45d36c 100644 Binary files a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/MP5.png and b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/MP5.png differ diff --git a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Rifle.png b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Rifle.png index 2bbb5539462dbe46b3d6d4e9d40f2d18a2256f69..ce307a8827bd75456441ceb57d530e4c8d45d36c 100644 Binary files a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Rifle.png and b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Rifle.png differ diff --git a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Winchester.png b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Winchester.png index 5a873ce7ce371c4ebc4c3f01b2448d88fa3bf4b9..ce307a8827bd75456441ceb57d530e4c8d45d36c 100644 Binary files a/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Winchester.png and b/code/BasicFeature/DeviceManagement/Vibrator/CustomHaptic/entry/src/main/resources/base/media/Winchester.png differ diff --git a/code/BasicFeature/FileManagement/FileShare/SandboxShare/README_zh.md b/code/BasicFeature/FileManagement/FileShare/SandboxShare/README_zh.md index d50fbe18ac6bb75551f7d544a31610277d5425ee..daa8974200957af45a5164b015920194b33a6d4d 100644 --- a/code/BasicFeature/FileManagement/FileShare/SandboxShare/README_zh.md +++ b/code/BasicFeature/FileManagement/FileShare/SandboxShare/README_zh.md @@ -12,7 +12,7 @@ 使用说明: -1. 因本应用的功能依赖Picker应用,在使用本应用之前首先应安装[Picker](code/BasicFeature/FileManagement/FileShare/Picker)应用; +1. 因本应用的功能依赖Picker应用,在使用本应用之前首先应安装[Picker](/code/SystemFeature/FileManagement/FileShare/Picker/README_zh.md)应用; 2. 在主界面,可以点击沙箱文件夹列出文件夹中的文件,同时也可以直接点击沙箱目录下的文件进入文件分享界面; 3. 点击沙箱文件,进入文件分享界面,点击分享图标,文件将以picker方式打开文件,点击编辑图标,文件进入可编辑模式,在textArea中输入内容,然后点击保存,文件内容更新,返回沙箱应用首页,文件修改成功。 @@ -34,13 +34,13 @@ entry/src/main/ets/ ``` ### 具体实现 -* 增添文件、查找指定类型文件、获取文件uri、传递want信息启动ability的功能接口封装在fileFs.ts,源码参考:[fileFs.ts](src/main/ets/fileFs/fileFs.ts) +* 增添文件、查找指定类型文件、获取文件uri、传递want信息启动ability的功能接口封装在fileFs.ts,源码参考:[fileFs.ts](/code/BasicFeature/FileManagement/FileShare/SandboxShare/entry/src/main/ets/fileFs/fileFs.ts) * 使用fs.mkdirSync、fs.openSync、fs.writeSync、fs.readSync、fs.closeSync分别用来来创建文件夹、打开文件、写文件、读文件、关闭文件,接口参考:[@ohos.file.fs](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-fs.md) * 使用fileUri.getUriFromPath来获取文件uri,接口参考:[@ohos.file.fileuri](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-fileuri.md) - * 分享文件至picker应用打开并编辑:在分享页面[show.ets](src/main/ets/pages/Show.ets) + * 分享文件至picker应用打开并编辑:在分享页面[show.ets](/code/BasicFeature/FileManagement/FileShare/SandboxShare/entry/src/main/ets/pages/Show.ets) 调用 implicitStartAbility 方法传递want参数启动新的ability,接口参考:[@ohos.ability.wantConstant](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ability-kit/js-apis-app-ability-wantConstant.md)、[@ohos.application.Want](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ability-kit/js-apis-app-ability-want.md) @@ -56,7 +56,7 @@ entry/src/main/ets/ ### 依赖 -本应用需要依赖[Picker](code/BasicFeature/FileManagement/FileShare/Picker)应用,沙箱文件需分享至Picker应用打开并编辑保存 +本应用需要依赖[Picker](/code/SystemFeature/FileManagement/FileShare/Picker/README_zh.md)应用,沙箱文件需分享至Picker应用打开并编辑保存 ### 约束与限制 diff --git a/code/BasicFeature/Media/AVRecorder/AppScope/app.json5 b/code/BasicFeature/Media/AVRecorder/AppScope/app.json5 index 8144c6d886269b3ff896fc5efd480b259346c513..00bb30fbdc79a07de238ff9750c690400eff8bcf 100644 --- a/code/BasicFeature/Media/AVRecorder/AppScope/app.json5 +++ b/code/BasicFeature/Media/AVRecorder/AppScope/app.json5 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/code/BasicFeature/Media/AVRecorder/README.md b/code/BasicFeature/Media/AVRecorder/README.md index 91017eb56aebbe6761a7c59d74ea615ae7e4e903..bf0883b99a3bc3bc52adad557c3d381d19c6964f 100644 --- a/code/BasicFeature/Media/AVRecorder/README.md +++ b/code/BasicFeature/Media/AVRecorder/README.md @@ -22,7 +22,7 @@ ohos.permission.WRITE_MEDIA, which allows an app to write media files to the use ### Constraints 1. This sample can only be run on standard-system devices that use the phone. -2. This sample is based on the stage model, which is supported from API version 9. You should manully fetch Full SDK from gitee and replace them in DevEco Studio. -3. DevEco Studio 3.1 Beta2 (Build Version:3.1.0.400, built on April 7, 2023) must be used. +2. This sample is based on the stage model, which is supported from API version 12. You should manully fetch Full SDK from gitee and replace them in DevEco Studio. +3. DevEco Studio Next 5.0 Beta1 (Build Version:5.0.3.800, built on Sep 4, 2024) must be used. 3. Camera apis can only be used by system app. In order to run this sample, you should generate signature manually with hap-sign-tool. diff --git a/code/BasicFeature/Media/AVRecorder/README_zh.md b/code/BasicFeature/Media/AVRecorder/README_zh.md index 88e54379d2b8697288015818bee0701cc1c33c8d..1ef12400391a0fe764f35190cc156c5ab286c6ec 100644 --- a/code/BasicFeature/Media/AVRecorder/README_zh.md +++ b/code/BasicFeature/Media/AVRecorder/README_zh.md @@ -2,9 +2,9 @@ ### 介绍 -音视频录制应用是基于AVRecorder接口开发的实现音频录制和视频录制功能的应用,音视频录制的主要工作是捕获音频信号,接收视频信号,完成音视频编码并保存到文件中,帮助开发者轻松实现音视频录制功能,包括开始录制、暂停录制、恢复录制、停止录制、释放资源等功能控制。它允许调用者指定录制的编码格式、封装格式、文件路径等参数。 +音视频录制应用是基于AVRecorder接口开发的实现音频录制和视频录制功能的应用,音视频录制的主要工作是捕获音频信号,接收视频信号,完成音视频编码并保存到文件中,帮助开发者轻松实现音视频录制功能,包括开始录制、暂停录制、恢复录制、停止录制、释放资源等功能控制。它允许调用者指定录制的图像size、音频采样频率等参数。 -本示例主要使用@ohos.multimedia.media中的AVRecorder接口实现了录制功能;另外辅助使用@ohos.multimedia.medialibrary接口,实现了创建录制文件功能,接口使用以及权限获取详见[媒体库管理](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-medialibrary.md)。使用@ohos.multimedia.camera接口,实现了相机预览及出流功能,接口使用以及权限获取详见[相机管理](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-camera-kit/js-apis-camera.md)。 +本示例主要使用@kit.MediaKit中的AVRecorder接口实现了录制功能;通过@kit.CoreFileKit接口支持,完成录制文件的创建,接口使用以及权限获取详见[文件管理](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/Readme-CN.md)。使用@kit.CameraKit接口,实现了相机预览及出流功能,接口使用以及权限获取详见[相机管理](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-camera-kit/js-apis-camera.md)。 ### 效果预览 @@ -18,6 +18,7 @@ 2. 在主界面,可以点击视频录制、音频录制进入对应功能界面。 3. 点击视频录制页面,进入页面呈现摄像头预览画面,用户可以通过点击左上角的设置图标进行视频分辨率参数设置,点击”开始“”暂停“”恢复“”停止“等对应图标按钮进行视频录控相关操作。 4. 点击音频录制页面,用户可以通过点击左上角的设置图标进行音频采样率参数设置,点击”开始“”暂停“”恢复“”停止“等对应图标按钮进行音频录控相关操作。 +5. 在RK板硬件平台上,录制功能的性能可能受限,请在多种设备上进行测试以确保兼容性。 ### 工程目录 @@ -40,8 +41,8 @@ entry/src/main/ets/ * 录控功能接口调用实现参考工程目录中的音频录制页面和视频录制页面 * 调用create()、prepare()、getInputSurface()、start()、pause()、resume()、stop()、reset()、release()接口实现录制器的创建、准备、录控操作、重置、销毁实例等功能; - * 视频录制[VRecorder.ets](entry/src/main/ets/recorder/VideoRecorder.ets)调用Camera接口实现相机出流功能配合视频录制功能,相机的实现方法参考自相机接口[@ohos.multimedia.camera](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-camera-kit/js-apis-camera.md) -* 调用MediaLibrary实现创建录制文件代码在[SaveCameraAsset.ets](entry/src/main/ets/utils/SaveCameraAsset.ets),实现方法参考[@ohos.multimedia.medialibrary](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-medialibrary.md)接口说明 + * 视频录制[VRecorder.ets](entry/src/main/ets/recorder/VideoRecorder.ets)调用Camera接口实现相机出流配合视频录制功能,相机的实现方法参考自相机接口[@kit.CameraKit](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-camera-kit/js-apis-camera.md) +* 调用文件基础服务接口实现创建录制文件代码在[SaveCameraAsset.ets](entry/src/main/ets/utils/SaveCameraAsset.ets),实现方法参考[@kit.CoreFileKit](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/Readme-CN.md)接口说明 ### 相关权限 @@ -51,7 +52,7 @@ entry/src/main/ets/ 1.允许应用使用麦克风:[ohos.permission.MICROPHONE](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionmicrophone) -2.允许应用使用相机拍摄照片和录制视频:[ohos.permission.CAMERA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-camera-kit/js-apis-camera.md) +2.允许应用使用相机拍照和录制视频:[ohos.permission.CAMERA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissioncamera) 3.允许应用读取用户外部存储中的媒体文件信息:[ohos.permission.READ_MEDIA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionread_media) @@ -67,9 +68,9 @@ entry/src/main/ets/ 1.本示例仅支持在标准系统上运行,支持设备:Phone。 -2.本示例仅支持API9版本SDK,版本号:3.2.10.8。 +2.本示例仅支持API12版本SDK,版本号:5.0.0.65。 -3.本示例使用的IDE版本信息:DevEco Studio 3.1 Beta2 (Build Version:3.1.0.400, built on April 7, 2023)。 +3.本示例使用的IDE版本信息:DevEco Studio Next 5.0 Beta1 (Build Version:5.0.3.800, built on Sep 4, 2024)。 4.相机、媒体库为系统接口,需要配置高权限签名,相关权限级别可查阅权限列表,需要配置系统应用签名,可以参考[特殊权限配置方法](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/hapsigntool-overview.md)。 diff --git a/code/BasicFeature/Media/AVRecorder/build-profile.json5 b/code/BasicFeature/Media/AVRecorder/build-profile.json5 index 21dc67a99d8a1ab4ba28397ac2a17c9c3dd39e7a..41281d08083bf4d6cbefbefa5f7a616697bc3ca1 100644 --- a/code/BasicFeature/Media/AVRecorder/build-profile.json5 +++ b/code/BasicFeature/Media/AVRecorder/build-profile.json5 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,12 +16,13 @@ { "app": { "signingConfigs": [], - "compileSdkVersion": 9, - "compatibleSdkVersion": 9, "products": [ { "name": "default", "signingConfig": "default", + "compileSdkVersion": 12, + "compatibleSdkVersion": 12, + "runtimeOS": "OpenHarmony" } ] }, diff --git a/code/BasicFeature/Media/AVRecorder/entry/build-profile.json5 b/code/BasicFeature/Media/AVRecorder/entry/build-profile.json5 index 5ef60de78f49384eb91a1ecbcdbe528285e501bb..ca237e5aebcd437d6d27bf1707d2b5e245faf23f 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/build-profile.json5 +++ b/code/BasicFeature/Media/AVRecorder/entry/build-profile.json5 @@ -1,17 +1,17 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +* Copyright (C) 2023-2024 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ { "apiType": 'stageMode', @@ -22,7 +22,7 @@ "name": "default" }, { - "name": "ohosTest", + "name": "ohosTest" } ] } \ No newline at end of file diff --git a/code/BasicFeature/Media/AVRecorder/entry/oh-package.json5 b/code/BasicFeature/Media/AVRecorder/entry/oh-package.json5 index 402bef64646483ab2c3fc838384c33188cf7bbc5..a228c91fbe9056706bd1c7b4c2c5b7422f67e087 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/oh-package.json5 +++ b/code/BasicFeature/Media/AVRecorder/entry/oh-package.json5 @@ -1,5 +1,5 @@ /* -* Copyright (C) 2023 Huawei Device Co., Ltd. +* Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -18,7 +18,6 @@ "devDependencies": {}, "name": "entry", "description": "example description", - "repository": {}, "version": "1.0.0", "dependencies": {} } diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/entryability/EntryAbility.ts b/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/entryability/EntryAbility.ts index dd23b30f1ad4910a0f9e926d6f5f06fe25eea967..0f8892bf4264681bb8a50b453e97d95fe5904c01 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/entryability/EntryAbility.ts +++ b/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/entryability/EntryAbility.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,10 +13,10 @@ * limitations under the License. */ -import UIAbility from '@ohos.app.ability.UIAbility'; -import type window from '@ohos.window'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; -import type { Permissions } from '@ohos.abilityAccessCtrl'; +import { UIAbility } from '@kit.AbilityKit'; +import { window } from '@kit.ArkUI'; +import { abilityAccessCtrl } from '@kit.AbilityKit'; +import { Permissions } from '@kit.AbilityKit'; import Logger from '../utils/Logger'; /** @@ -33,14 +33,13 @@ export default class EntryAbility extends UIAbility { atManager.requestPermissionsFromUser(globalThis.abilityContext, permissionNames).then((data) => { Logger.info('testTag', 'requestPermissionsFromUser called'); }); - AppStorage.SetOrCreate('context', this.context); } onDestroy() { Logger.info('testTag', 'Ability onDestroy'); } - async onWindowStageCreate(windowStage: window.WindowStage): Promise { + async onWindowStageCreate(windowStage: window.WindowStage) { // Main window is created, set main page for this ability Logger.info('testTag', 'Ability onWindowStageCreate'); diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/pages/ListPage.ets b/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/pages/ListPage.ets index 5f203204714bd299c67c6d836e16a59b911554b8..fad80ae403d7a7e671ade586e2ef3c45bd531459 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/pages/ListPage.ets +++ b/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/pages/ListPage.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,9 +13,7 @@ * limitations under the License. */ -import router from '@ohos.router'; -import common from '@ohos.app.ability.common'; -import Want from '@ohos.app.ability.Want'; +import { router } from '@kit.ArkUI'; import Logger from '../utils/Logger'; @Entry @@ -44,16 +42,9 @@ struct ListPage { .backgroundColor($r('app.color.button_background')) .borderRadius(24) .onClick(() => { - let context: common.UIAbilityContext | undefined = AppStorage.Get('context'); - let want: Want = { - bundleName: "com.samples.video_recorder", - abilityName: "EntryAbility", - }; - context && context.startAbility(want, (err) => { - if (err.code) { - Logger.error('StartAbility', `Failed to startAbility. Code: ${err.code}, message: ${err.message}`); - } - }); + router.pushUrl({ + url: 'recorder/VideoRecorder', + }) }) .margin({ left: 12, right:12, top: 0, bottom:12}) Button() { diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/recorder/AudioRecorder.ets b/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/recorder/AudioRecorder.ets index ceab0e8bba0e200125ebab6c889ccae0a07348c9..6415057fd47132b8f8ebecbcdec8884fdb3050a5 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/recorder/AudioRecorder.ets +++ b/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/recorder/AudioRecorder.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,8 @@ * limitations under the License. */ -import media from '@ohos.multimedia.media'; +import { media } from '@kit.MediaKit'; +import { BusinessError } from '@kit.BasicServicesKit'; import { dateTime } from '../utils/DateTimeUtils'; import Logger from '../utils/Logger'; import SaveCameraAsset from '../utils/SaveCameraAsset'; @@ -23,29 +24,29 @@ const TAG: string = 'Sample_AudioRecorder'; @Entry @Component struct AudioRecording { - private audioRecorder: media.AVRecorder; - private fdPath: string = undefined; + private audioRecorder?: media.AVRecorder; + private fdPath?: string = ''; @State frameRate: number = 15; @State audioRecorderTimeText: string = '00:00'; private seconds: number = 0; private timer: number = 0; - @State displayLog: string = undefined; + @State displayLog: string = ''; private recorderState: string = 'free'; @State isStartRecording: boolean = false; @State isPauseRecording: boolean = false; private mSaveCameraAsset: SaveCameraAsset = new SaveCameraAsset(TAG); - private mFileAssetId: number = 0; // init fd 0 + private mFileAssetId?: number = 0; // init fd 0 @State audioChannels: number = 2; // set default audioChannels 2 @State audioSampleRate: number = 48000; // set default audioSampleRate 48000 - private avProfile = { - audioBitrate: 48000, // set audioBitrate according to device ability - audioChannels: 2, // set audioChannels, valid value 1-8 + private avProfile: media.AVRecorderProfile = { + audioBitrate: 64000, // set audioBitrate according to device ability + audioChannels: 1, // set audioChannels, valid value 1-8 audioCodec: media.CodecMimeType.AUDIO_AAC, // set audioCodec, AUDIO_AAC is the only choice - audioSampleRate: 48000, // set audioSampleRate according to device ability + audioSampleRate: 8000, // set audioSampleRate according to device ability fileFormat: media.ContainerFormatType.CFT_MPEG_4A, // set fileFormat, for video is m4a } - private avConfig = { + private avConfig: media.AVRecorderConfig = { audioSourceType: media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC, profile: this.avProfile, url: 'fd://' @@ -61,11 +62,11 @@ struct AudioRecording { Logger.info(TAG, 'aboutToDisappear done'); } - async failureCallback(error): Promise { + async failureCallback(error: BusinessError): Promise { Logger.info(TAG, 'case failureCallback called,errMessage is ' + error.message); } - async catchCallback(error): Promise { + async catchCallback(error: BusinessError): Promise { Logger.info(TAG, 'case catchCallback called,errMessage is ' + error.message); } @@ -103,89 +104,103 @@ struct AudioRecording { // set callback on setCallback(): void { Logger.info(TAG, 'case callback'); - this.audioRecorder.on('stateChange', (state, reason) => { - Logger.info(TAG, 'case state has changed, new state is' + state); - switch (state) { - case 'idle': - this.recorderState = 'idle'; - break; - case 'prepared': - this.recorderState = 'prepared'; - break; - case 'started': - this.recorderState = 'started'; - this.getRecordTime(); - this.isStartRecording = true; - this.isPauseRecording = false; - break; - case 'paused': - this.recorderState = 'paused'; - clearInterval(this.timer); - this.isPauseRecording = true; - break; - case 'stopped': - this.recorderState = 'stopped'; - this.isStartRecording = false; - break; - case 'released': - this.recorderState = 'released'; - break; - case 'error': - Logger.info(TAG, 'case error state!!!'); - this.recorderState = 'error'; - break; - default: - Logger.info(TAG, 'case start is unknown'); - break; - } - }); - this.audioRecorder.on('error', (err) => { - Logger.info(TAG, 'case avRecorder.on(error) called, errMessage is ' + err.message); - }); + if (this.audioRecorder) { + this.audioRecorder.on('stateChange', (state, reason) => { + Logger.info(TAG, 'case state has changed, new state is' + state); + switch (state) { + case 'idle': + this.recorderState = 'idle'; + break; + case 'prepared': + this.recorderState = 'prepared'; + break; + case 'started': + this.recorderState = 'started'; + this.getRecordTime(); + this.isStartRecording = true; + this.isPauseRecording = false; + break; + case 'paused': + this.recorderState = 'paused'; + clearInterval(this.timer); + this.isPauseRecording = true; + break; + case 'stopped': + this.recorderState = 'stopped'; + this.isStartRecording = false; + break; + case 'released': + this.recorderState = 'released'; + break; + case 'error': + Logger.info(TAG, 'case error state!!!'); + this.recorderState = 'error'; + break; + default: + Logger.info(TAG, 'case start is unknown'); + break; + } + }); + this.audioRecorder.on('error', (err) => { + Logger.info(TAG, 'case avRecorder.on(error) called, errMessage is ' + err.message); + }); + } } async prepareAudioRecorder(): Promise { Logger.info(TAG, 'case prepareAudioRecorder in'); this.avConfig.profile.audioChannels = this.audioChannels; this.avConfig.profile.audioSampleRate = this.audioSampleRate; - await this.audioRecorder.prepare(this.avConfig).then(() => { - Logger.info(TAG, 'case prepare AVRecorder called'); - }, this.failureCallback).catch(this.catchCallback); + if (this.audioRecorder) { + await this.audioRecorder.prepare(this.avConfig).then(() => { + Logger.info(TAG, 'case prepare AVRecorder called'); + }, this.failureCallback).catch(this.catchCallback); + } Logger.info(TAG, 'case prepareAudioRecorder out'); } async startAudioRecording(): Promise { Logger.info(TAG, 'case startAudioRecording called'); - await this.audioRecorder.start().then(() => { - Logger.info(TAG, 'case start AudioRecorder called'); - }, this.failureCallback).catch(this.catchCallback); + if (this.audioRecorder) { + await this.audioRecorder.start().then(() => { + Logger.info(TAG, 'case start AudioRecorder called'); + }, this.failureCallback).catch(this.catchCallback); + } } async pauseAudioRecording(): Promise { Logger.info(TAG, 'case pauseAudioRecording called'); - await this.audioRecorder.pause().then(() => { - Logger.info(TAG, 'case pause AudioRecorder called'); - }, this.failureCallback).catch(this.catchCallback); + if (this.audioRecorder) { + await this.audioRecorder.pause().then(() => { + Logger.info(TAG, 'case pause AudioRecorder called'); + }, this.failureCallback).catch(this.catchCallback); + } } async resumeAudioRecording(): Promise { Logger.info(TAG, 'case resumeAudioRecording called'); - await this.audioRecorder.resume().then(() => { - Logger.info(TAG, 'case resume AudioRecorder called'); - }, this.failureCallback).catch(this.catchCallback); + if (this.audioRecorder) { + await this.audioRecorder.resume().then(() => { + Logger.info(TAG, 'case resume AudioRecorder called'); + }, this.failureCallback).catch(this.catchCallback); + } } async stopAudioRecording(): Promise { Logger.info(TAG, 'case stopAudioRecording called'); - await this.audioRecorder.stop().then(() => { - Logger.info(TAG, 'case stop AudioRecorder called'); - }, this.failureCallback).catch(this.catchCallback); + if (this.audioRecorder) { + await this.audioRecorder.stop().then(() => { + Logger.info(TAG, 'case stop AudioRecorder called'); + }, this.failureCallback).catch(this.catchCallback); + } } async resetAudioRecording(): Promise { - await this.audioRecorder.reset().then(() => { - Logger.info(TAG, 'case resetAudioRecording called'); - }, this.failureCallback).catch(this.catchCallback); + if (this.audioRecorder) { + await this.audioRecorder.reset().then(() => { + Logger.info(TAG, 'case resetAudioRecording called'); + }, this.failureCallback).catch(this.catchCallback); + } } async releaseAudioRecorder(): Promise { @@ -202,8 +217,8 @@ struct AudioRecording { // close file fd async closeFd(): Promise { Logger.info(TAG, 'case closeFd called'); - if (this.fdPath) { - await this.mSaveCameraAsset.AudioPrepareFile.close(this.mFileAssetId); + if (this.mSaveCameraAsset) { + await this.mSaveCameraAsset.closeAudioFile(); this.mFileAssetId = undefined; this.fdPath = undefined; Logger.info(TAG, 'case closeFd done'); @@ -367,8 +382,8 @@ struct CustomDialogSetting { @Link audioChannels: number @Link audioSampleRate: number controller: CustomDialogController - cancel: () => void - confirm: () => void + cancel?: () => void + confirm?: () => void @State currentAudioChannels: number = 2 @State currentAudioSampleRate: number = 48000 private initAudioChannels: number = this.audioChannels @@ -387,7 +402,7 @@ struct CustomDialogSetting { .margin({ left: 24, right: 24, top: 16 }) Column() { List({ space: 10 }) { - ForEach(this.audioSampleRateList, (item, index) => { + ForEach(this.audioSampleRateList, (item: number, index) => { ListItem() { Row() { Text($r('app.string.audio_samplerate')) @@ -429,7 +444,9 @@ struct CustomDialogSetting { this.audioChannels = this.initAudioChannels this.audioSampleRate = this.initAudioSampleRate this.controller.close() - this.cancel() + if (this.cancel) { + this.cancel() + } }) .backgroundColor($r('app.color.button_background')) .fontColor($r('app.color.button_color')) @@ -448,7 +465,9 @@ struct CustomDialogSetting { this.audioChannels = this.currentAudioChannels this.audioSampleRate = this.currentAudioSampleRate this.controller.close() - this.confirm() + if (this.confirm) { + this.confirm() + } }) .backgroundColor($r('app.color.button_background')) .fontColor($r('app.color.button_color')) diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/recorder/VideoRecorder.ets b/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/recorder/VideoRecorder.ets index d0959138fbe094b68ad5a4f6dafa6b279eceb35b..ffd051389e9be4e01ed6b842d2a08971090f11cd 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/recorder/VideoRecorder.ets +++ b/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/recorder/VideoRecorder.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,8 +13,9 @@ * limitations under the License. */ -import camera from '@ohos.multimedia.camera'; -import media from '@ohos.multimedia.media'; +import { camera } from '@kit.CameraKit'; +import { media } from '@kit.MediaKit'; +import { BusinessError } from '@kit.BasicServicesKit'; import { dateTime } from '../utils/DateTimeUtils'; import Logger from '../utils/Logger'; import SaveCameraAsset from '../utils/SaveCameraAsset'; @@ -26,44 +27,44 @@ const TAG: string = 'Sample_VideoRecorder'; struct VideoRecording { private surfaceId: string = ''; xcomponentController: XComponentController = new XComponentController(); - private videoRecorder: media.AVRecorder; - private cameraManager: camera.CameraManager; - private cameras: any = undefined; - private cameraInput: camera.CameraInput; - private captureSession: camera.CaptureSession; - private previewOutput: camera.PreviewOutput; - private videoOutput: camera.VideoOutput; + private videoRecorder?: media.AVRecorder; + private cameraManager?: camera.CameraManager; + private cameras?: Array; + private cameraInput?: camera.CameraInput; + private captureSession?: camera.CaptureSession; + private previewOutput?: camera.PreviewOutput; + private videoOutput?: camera.VideoOutput; private videoOutSurfaceId: string = ''; - private fdPath: string = undefined; + private fdPath?: string = ''; @State videoRecorderTimeText: string = '00:00'; private seconds: number = 0; private timer: number = 0; private cameraIndex: number = 0; - @State videoResolution: object = { 'frameWidth': 1280, 'frameHeight': 720}; + @State videoResolution: Resolution = { frameWidth: 1920, frameHeight: 1080}; @State framerate: number = 30; // set default video framerate 30 @State videoCodecType: string = 'video/avc'; private recorderState: string = 'free'; @State isStartRecording: boolean = false; @State isPauseRecording: boolean = false; private mSaveCameraAsset: SaveCameraAsset = new SaveCameraAsset(TAG); - private mFileAssetId: number = 0; - private cameraOutputCapability: camera.CameraOutputCapability = undefined; - private videoProfiles: any = undefined; - private previewProfiles: any = undefined; + private mFileAssetId?: number = 0; + private cameraOutputCapability?: camera.CameraOutputCapability; + private curVideoProfiles?: Array; + private previewProfiles?: Array; - private avProfile = { + private avProfile: media.AVRecorderProfile = { audioBitrate: 200000, // set audioBitrate according to device ability audioChannels: 2, // set audioChannels, valid value 1-8 audioCodec: media.CodecMimeType.AUDIO_AAC, // set audioCodec, AUDIO_AAC is the only choice audioSampleRate: 48000, // set audioSampleRate according to device ability fileFormat: media.ContainerFormatType.CFT_MPEG_4, // set fileFormat, for video is mp4 - videoBitrate: 300000, // set videoBitrate according to device ability + videoBitrate: 3000000, // set videoBitrate according to device ability videoCodec: media.CodecMimeType.VIDEO_AVC, // set videoCodec, avc or mpeg4 can be selected videoFrameWidth: 640, // set videoFrameWidth according to device ability videoFrameHeight: 480, // set videoFrameHeight according to device ability videoFrameRate: 30 // set videoFrameRate according to device ability } - private avConfig = { + private avConfig: media.AVRecorderConfig = { audioSourceType: media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC, videoSourceType: media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV, profile: this.avProfile, @@ -91,11 +92,11 @@ struct VideoRecording { this.stopRecordingProcess(); } - async failureCallback(error): Promise { + async failureCallback(error: BusinessError): Promise { Logger.info(TAG, 'case failureCallback called,errMessage is ' + error.message); } - async catchCallback(error): Promise { + async catchCallback(error: BusinessError): Promise { Logger.info(TAG, 'case catchCallback called,errMessage is ' + error.message); } @@ -139,59 +140,65 @@ struct VideoRecording { Logger.info(TAG, '[camera] case getCameras failed'); } this.cameraOutputCapability = this.cameraManager.getSupportedOutputCapability(this.cameras[this.cameraIndex]); - this.videoProfiles = this.cameraOutputCapability.videoProfiles; + this.curVideoProfiles = this.cameraOutputCapability.videoProfiles; Logger.info(TAG, 'init camera done'); } // create camera input async createCameraInput(): Promise { Logger.info(TAG, 'createCameraInput called'); - this.cameraInput = this.cameraManager.createCameraInput(this.cameras[this.cameraIndex]); - if (this.cameraInput) { - Logger.info(TAG, '[camera] case createCameraInput success'); - } else { - Logger.info(TAG, '[camera] case createCameraInput failed'); - return; + if (this.cameraManager && this.cameras && this.cameras.length > 0) { + this.cameraInput = this.cameraManager.createCameraInput(this.cameras[this.cameraIndex]); + if (this.cameraInput) { + Logger.info(TAG, '[camera] case createCameraInput success'); + } else { + Logger.info(TAG, '[camera] case createCameraInput failed'); + return; + } + await this.cameraInput.open().then(() => { + Logger.info(TAG, '[camera] case cameraInput.open() called'); + }, this.failureCallback).catch(this.catchCallback); } - await this.cameraInput.open().then(() => { - Logger.info(TAG, '[camera] case cameraInput.open() called'); - }, this.failureCallback).catch(this.catchCallback); } // create camera preview async createPreviewOutput(): Promise { Logger.info(TAG, 'createPreviewOutput called'); - this.previewProfiles = this.cameraOutputCapability.previewProfiles; - this.previewProfiles[0].size.height = this.videoResolution['frameHeight']; - this.previewProfiles[0].size.width = this.videoResolution['frameWidth']; - if (this.previewProfiles[0].format === camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP) { - Logger.info(TAG, '[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_YUV'); - this.avConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV; - } else { - Logger.info(TAG, '[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_ES'); - this.avConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES; - } - this.previewOutput = this.cameraManager.createPreviewOutput(this.previewProfiles[0], this.surfaceId); - if (!this.previewOutput) { - Logger.info(TAG, 'create previewOutput failed!'); + if (this.cameraOutputCapability && this.cameraManager) { + this.previewProfiles = this.cameraOutputCapability.previewProfiles; + this.previewProfiles[0].size.height = this.videoResolution.frameHeight; + this.previewProfiles[0].size.width = this.videoResolution.frameWidth; + if (this.previewProfiles[0].format === camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP) { + Logger.info(TAG, '[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_YUV'); + this.avConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV; + } else { + Logger.info(TAG, '[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_ES'); + this.avConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES; + } + this.previewOutput = this.cameraManager.createPreviewOutput(this.previewProfiles[0], this.surfaceId); + if (!this.previewOutput) { + Logger.info(TAG, 'create previewOutput failed!'); + } + Logger.info(TAG, 'createPreviewOutput done'); } - Logger.info(TAG, 'createPreviewOutput done'); } // create camera capture session async createCaptureSession(): Promise { Logger.info(TAG, 'createCaptureSession called'); - this.captureSession = this.cameraManager.createCaptureSession(); - if (!this.captureSession) { - Logger.info(TAG, 'createCaptureSession failed!'); - return + if (this.cameraManager) { + this.captureSession = this.cameraManager.createCaptureSession(); + if (!this.captureSession) { + Logger.info(TAG, 'createCaptureSession failed!'); + return + } + this.captureSession.beginConfig(); + this.captureSession.addInput(this.cameraInput); + this.captureSession.addOutput(this.previewOutput); + await this.captureSession.commitConfig().then(() => { + Logger.info(TAG, 'case commitConfig success'); + }, this.failureCallback).catch(this.catchCallback); } - this.captureSession.beginConfig(); - this.captureSession.addInput(this.cameraInput); - this.captureSession.addOutput(this.previewOutput); - await this.captureSession.commitConfig().then(() => { - Logger.info(TAG, 'case commitConfig success'); - }, this.failureCallback).catch(this.catchCallback); } // start captureSession @@ -211,8 +218,10 @@ struct VideoRecording { Logger.info(TAG, 'removeVideoOutput called'); if (this.videoOutput) { Logger.info(TAG, 'videoOutput already exits, remove it'); - this.captureSession.removeOutput(this.videoOutput); - Logger.info(TAG, 'remove videoOutput done'); + if (this.captureSession) { + this.captureSession.removeOutput(this.videoOutput); + Logger.info(TAG, 'remove videoOutput done'); + } } Logger.info(TAG, 'removeVideoOutput done'); } @@ -220,10 +229,10 @@ struct VideoRecording { // create video output async createVideoOutput(): Promise { Logger.info(TAG, 'createVideoOutput called'); - if (this.videoRecorder) { - this.videoProfiles[this.cameraIndex].size.height = this.videoResolution['frameHeight']; - this.videoProfiles[this.cameraIndex].size.width = this.videoResolution['frameWidth']; - this.videoOutput = this.cameraManager.createVideoOutput(this.videoProfiles[this.cameraIndex], this.videoOutSurfaceId); + if (this.videoRecorder && this.curVideoProfiles && this.cameraManager) { + this.curVideoProfiles[this.cameraIndex].size.height = this.videoResolution.frameHeight; + this.curVideoProfiles[this.cameraIndex].size.width = this.videoResolution.frameWidth; + this.videoOutput = this.cameraManager.createVideoOutput(this.curVideoProfiles[this.cameraIndex], this.videoOutSurfaceId); if (!this.videoOutput) { Logger.info(TAG, '[camera] case create videoOutPut fail!!!'); return; @@ -239,24 +248,26 @@ struct VideoRecording { // add video output into CaptureSession async restartVideoOutput(): Promise { Logger.info(TAG, 'restartVideoOutput called'); - await this.captureSession.stop().then(() => { - Logger.info(TAG, 'case stop captureSession success'); - }, this.failureCallback).catch(this.catchCallback); - this.captureSession.beginConfig(); - await this.removeVideoOutput(); - await this.createVideoOutput(); - this.captureSession.addOutput(this.videoOutput); - await this.captureSession.commitConfig().then(() => { - Logger.info(TAG, 'case commitConfig success'); - }, this.failureCallback).catch(this.catchCallback); - await this.startCaptureSession(); - if (this.videoOutput) { - await this.videoOutput.start().then(() => { - Logger.info(TAG, '[camera] case videoOutput start success'); + if (this.captureSession) { + await this.captureSession.stop().then(() => { + Logger.info(TAG, 'case stop captureSession success'); }, this.failureCallback).catch(this.catchCallback); - } else { - Logger.info(TAG, 'videoOutput is null!!!'); - return; + this.captureSession.beginConfig(); + await this.removeVideoOutput(); + await this.createVideoOutput(); + this.captureSession.addOutput(this.videoOutput); + await this.captureSession.commitConfig().then(() => { + Logger.info(TAG, 'case commitConfig success'); + }, this.failureCallback).catch(this.catchCallback); + await this.startCaptureSession(); + if (this.videoOutput) { + await this.videoOutput.start().then(() => { + Logger.info(TAG, '[camera] case videoOutput start success'); + }, this.failureCallback).catch(this.catchCallback); + } else { + Logger.info(TAG, 'videoOutput is null!!!'); + return; + } } } @@ -290,7 +301,7 @@ struct VideoRecording { async releaseCameraInput(): Promise { Logger.info(TAG, 'releaseCameraInput called'); if (this.cameraInput) { - this.cameraInput = null; + this.cameraInput = undefined; } Logger.info(TAG, 'releaseCameraInput done'); } @@ -302,7 +313,7 @@ struct VideoRecording { await this.previewOutput.release().then(() => { Logger.info('[camera] case main previewOutput release called'); }, this.failureCallback).catch(this.catchCallback); - this.previewOutput = null; + this.previewOutput = undefined; } Logger.info(TAG, 'releasePreviewOutput done'); } @@ -314,7 +325,7 @@ struct VideoRecording { await this.videoOutput.release().then(() => { Logger.info('[camera] case main videoOutput release called'); }, this.failureCallback).catch(this.catchCallback); - this.videoOutput = null; + this.videoOutput = undefined; } Logger.info(TAG, 'releaseVideoOutput done'); } @@ -337,7 +348,7 @@ struct VideoRecording { await this.captureSession.release().then(() => { Logger.info('[camera] case main captureSession release success'); }, this.failureCallback).catch(this.catchCallback); - this.captureSession = null; + this.captureSession = undefined; } Logger.info(TAG, 'releaseCaptureSession done'); } @@ -356,45 +367,47 @@ struct VideoRecording { // set callback on setCallback(): void { Logger.info('case callback'); - this.videoRecorder.on('stateChange', (state, reason) => { - Logger.info('case state has changed, new state is' + state); - switch (state) { - case 'idle': - this.recorderState = 'idle'; - break; - case 'prepared': - this.recorderState = 'prepared'; - break; - case 'started': - this.recorderState = 'started'; - this.getRecordTime(); - this.isStartRecording = true; - this.isPauseRecording = false; - break; - case 'paused': - this.recorderState = 'paused'; - clearInterval(this.timer); - this.isPauseRecording = true; - break; - case 'stopped': - this.recorderState = 'stopped'; - this.isStartRecording = false; - break; - case 'released': - this.recorderState = 'released'; - break; - case 'error': - Logger.info('case error state!!!'); - this.recorderState = 'error'; - break; - default: - Logger.info('case start is unknown'); - break; - } - }); - this.videoRecorder.on('error', (err) => { - Logger.info(TAG, 'case avRecorder.on(error) called, errMessage is ' + err.message); - }); + if (this.videoRecorder) { + this.videoRecorder.on('stateChange', (state, reason) => { + Logger.info('case state has changed, new state is' + state); + switch (state) { + case 'idle': + this.recorderState = 'idle'; + break; + case 'prepared': + this.recorderState = 'prepared'; + break; + case 'started': + this.recorderState = 'started'; + this.getRecordTime(); + this.isStartRecording = true; + this.isPauseRecording = false; + break; + case 'paused': + this.recorderState = 'paused'; + clearInterval(this.timer); + this.isPauseRecording = true; + break; + case 'stopped': + this.recorderState = 'stopped'; + this.isStartRecording = false; + break; + case 'released': + this.recorderState = 'released'; + break; + case 'error': + Logger.info('case error state!!!'); + this.recorderState = 'error'; + break; + default: + Logger.info('case start is unknown'); + break; + } + }); + this.videoRecorder.on('error', (err) => { + Logger.info(TAG, 'case avRecorder.on(error) called, errMessage is ' + err.message); + }); + } } async createVideoRecorder(): Promise { @@ -417,61 +430,75 @@ struct VideoRecording { } else { this.avConfig.profile.videoCodec = media.CodecMimeType.VIDEO_AVC; } - this.avConfig.profile.videoFrameHeight = this.videoResolution['frameHeight']; - this.avConfig.profile.videoFrameWidth = this.videoResolution['frameWidth']; + this.avConfig.profile.videoFrameHeight = this.videoResolution.frameHeight; + this.avConfig.profile.videoFrameWidth = this.videoResolution.frameWidth; this.avConfig.profile.videoFrameRate = this.framerate; - await this.videoRecorder.prepare(this.avConfig).then(() => { - Logger.info(TAG, 'case prepare AVRecorder called'); - }, this.failureCallback).catch(this.catchCallback); - Logger.info(TAG, 'case prepareVideoRecorder out'); + if (this.videoRecorder) { + await this.videoRecorder.prepare(this.avConfig).then(() => { + Logger.info(TAG, 'case prepare AVRecorder called'); + }, this.failureCallback).catch(this.catchCallback); + Logger.info(TAG, 'case prepareVideoRecorder out'); + } } async getInputSurface(): Promise { Logger.info(TAG, 'case getInputSurface in'); - await this.videoRecorder.getInputSurface().then((outPutSurface) => { - Logger.info('case getInputSurface called'); - if (!outPutSurface) { - Logger.error(TAG, 'case getInputSurface ID is none'); - return - } - this.videoOutSurfaceId = outPutSurface; - Logger.info(TAG, 'case outPutSurface surfaceID is: ${this.videoOutSurfaceId}'); - }, this.failureCallback).catch(this.catchCallback); + if (this.videoRecorder) { + await this.videoRecorder.getInputSurface().then((outPutSurface) => { + Logger.info('case getInputSurface called'); + if (!outPutSurface) { + Logger.error(TAG, 'case getInputSurface ID is none'); + return + } + this.videoOutSurfaceId = outPutSurface; + Logger.info(TAG, 'case outPutSurface surfaceID is: ${this.videoOutSurfaceId}'); + }, this.failureCallback).catch(this.catchCallback); + } Logger.info(TAG, 'case getInputSurface out'); } async startVideoRecording(): Promise { Logger.info(TAG, 'case startVideoRecording called'); - await this.videoRecorder.start().then(() => { - Logger.info(TAG, 'case start VideoRecorder called'); - }, this.failureCallback).catch(this.catchCallback); + if (this.videoRecorder) { + await this.videoRecorder.start().then(() => { + Logger.info(TAG, 'case start VideoRecorder called'); + }, this.failureCallback).catch(this.catchCallback); + } } async pauseVideoRecording(): Promise { Logger.info(TAG, 'case pauseVideoRecording called'); - await this.videoRecorder.pause().then(() => { - Logger.info(TAG, 'case pause VideoRecorder called'); - }, this.failureCallback).catch(this.catchCallback); + if (this.videoRecorder) { + await this.videoRecorder.pause().then(() => { + Logger.info(TAG, 'case pause VideoRecorder called'); + }, this.failureCallback).catch(this.catchCallback); + } } async resumeVideoRecording(): Promise { Logger.info(TAG, 'case resumeVideoRecording called'); - await this.videoRecorder.resume().then(() => { - Logger.info(TAG, 'case resume VideoRecorder called'); - }, this.failureCallback).catch(this.catchCallback); + if (this.videoRecorder) { + await this.videoRecorder.resume().then(() => { + Logger.info(TAG, 'case resume VideoRecorder called'); + }, this.failureCallback).catch(this.catchCallback); + } } async stopVideoRecording(): Promise { Logger.info(TAG, 'case stopVideoRecording called'); - await this.videoRecorder.stop().then(() => { - Logger.info(TAG, 'case stop VideoRecorder called'); - }, this.failureCallback).catch(this.catchCallback); + if (this.videoRecorder) { + await this.videoRecorder.stop().then(() => { + Logger.info(TAG, 'case stop VideoRecorder called'); + }, this.failureCallback).catch(this.catchCallback); + } } async resetVideoRecording(): Promise { - await this.videoRecorder.reset().then(() => { - Logger.info(TAG, 'case resetVideoRecording called'); - }, this.failureCallback).catch(this.catchCallback); + if (this.videoRecorder) { + await this.videoRecorder.reset().then(() => { + Logger.info(TAG, 'case resetVideoRecording called'); + }, this.failureCallback).catch(this.catchCallback); + } } async releaseVideoRecorder(): Promise { @@ -488,8 +515,8 @@ struct VideoRecording { // close file fd async closeFd(): Promise { Logger.info(TAG, 'case closeFd called'); - if (this.fdPath) { - await this.mSaveCameraAsset.VideoPrepareFile.close(this.mFileAssetId); + if (this.mSaveCameraAsset) { + await this.mSaveCameraAsset.closeVideoFile(); this.mFileAssetId = undefined; this.fdPath = undefined; Logger.info(TAG, 'case closeFd done'); @@ -575,7 +602,6 @@ struct VideoRecording { this.surfaceId = this.xcomponentController.getXComponentSurfaceId() Logger.info(TAG, '[VideoRecorder] surfaceId: ' + this.surfaceId) Logger.info(TAG, 'XComponent1 loaded'); - this.enterInit(); }) .width('100%').height('100%') Text(this.videoRecorderTimeText) @@ -675,32 +701,51 @@ struct VideoRecording { }) } +class Resolution { + public frameWidth: number = 0 + public frameHeight: number = 0 +} + +class VideoResolution { + public itemValue: string = '' + public value: Resolution = { frameWidth: 0, frameHeight: 0 } +} + +class VideoFrameRate { + public itemValue: string = '' + public value: number = 0 +} + +class VideoCodec { + public itemValue: string = '' + public value: string = '' +} @CustomDialog struct CustomDialogSetting { - @Link videoResolution: Object + @Link videoResolution: Resolution @Link videoFrameRate: number @Link videoCodec: string controller: CustomDialogController - cancel: () => void - confirm: () => void - @State currentVideoResolution: Object = { 'frameWidth': 1280, 'frameHeight': 720 } - @State currentVideoResolutionText: string = '[16:9]720p' + cancel?: () => void + confirm?: () => void + @State currentVideoResolution: Resolution = { frameWidth: 1920, frameHeight: 1080 } + @State currentVideoResolutionText: string = '[16:9]1080p' @State currentVideoFramerate: number = 30 @State currentVideoCodec: string = 'video/avc' - private initVideoResolution: Object = this.videoResolution + private initVideoResolution: Resolution = this.videoResolution private initVideoFramerate: number = this.videoFrameRate - private initVideoCodec: string = this.videoCodec - @State videoResolutionList: Array = [ - { 'itemValue': '16:9 (720p)', 'value': { 'frameWidth': 1280, 'frameHeight': 720 } }, - { 'itemValue': '16:9 (1080p)', 'value': { 'frameWidth': 1920, 'frameHeight': 1080 } }, + private initVideoCodec: string = 'video/avc' + @State videoResolutionList: Array = [ + { itemValue: '16:9 (720p)', value: { frameWidth: 1280, frameHeight: 720 } }, + { itemValue: '16:9 (1080p)', value: { frameWidth: 1920, frameHeight: 1080 } }, ] - @State videoFrameRateList: Array = [ - { 'itemValue': '30fps', 'value': 30 }, + @State videoFrameRateList: Array = [ + { itemValue: '30fps', value: 30 }, ] - @State videoCodecList: Array = [ - { 'itemValue': 'video/avc', 'value': 'video/avc' }, - { 'itemValue': 'video/mpeg4', 'value': 'video/mpeg4' }, + @State videoCodecList: Array = [ + { itemValue: 'video/avc', value: 'video/avc' }, + { itemValue: 'video/mpeg4', value: 'video/mpeg4' }, ] build() { @@ -714,7 +759,7 @@ struct CustomDialogSetting { .margin({ left: 24, top: 16, right: 24 }) Column() { List({ space: 10 }) { - ForEach(this.videoResolutionList, (item, index) => { + ForEach(this.videoResolutionList, (item: VideoResolution, index) => { ListItem() { Row() { Text($r('app.string.video_resolution')) @@ -724,7 +769,7 @@ struct CustomDialogSetting { .width(160) .fontFamily('HarmonyHeiTi-Medium') Radio({ value: item.value.toString(), group: 'radioGroup' }) - .checked(item.value['frameWidth'] == this.initVideoResolution['frameWidth']) + .checked(item.value.frameWidth == this.initVideoResolution.frameWidth) .height(24) .onChange((isChecked: boolean) => { if (isChecked) { @@ -747,7 +792,9 @@ struct CustomDialogSetting { this.videoFrameRate = this.initVideoFramerate this.videoCodec = this.initVideoCodec this.controller.close() - this.cancel() + if (this.cancel) { + this.cancel() + } }) .backgroundColor($r('app.color.button_background')) .fontColor($r('app.color.button_color')) @@ -767,7 +814,9 @@ struct CustomDialogSetting { this.videoFrameRate = this.currentVideoFramerate this.videoCodec = this.currentVideoCodec this.controller.close() - this.confirm() + if (this.confirm) { + this.confirm() + } }) .backgroundColor($r('app.color.button_background')) .fontColor($r('app.color.button_color')) diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/utils/DateTimeUtils.ets b/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/utils/DateTimeUtils.ets index f94677038f5e60aa43ca83a42d6e336fdc00aa94..76c5c325f2e7a84a5a3bc1aa8a61ada0f7d17664 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/utils/DateTimeUtils.ets +++ b/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/utils/DateTimeUtils.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -37,20 +37,20 @@ export default class DateTimeUtil { } } -export function getShownTimer(ms): string { - let seconds: any = Math.round(ms / 1000); - let sec: any = seconds % 60; - let min: any = (seconds - sec) / 60; +export function getShownTimer(ms: number): string { + let seconds: number = Math.round(ms / 1000); + let sec: number = seconds % 60; + let min: number = (seconds - sec) / 60; if (sec < 10) { - sec = '0' + sec; + sec = 0 + sec; } if (min < 10) { - min = '0' + min; + min = 0 + min; } return min + ':' + sec; } -export function dateTime(t): string { +export function dateTime(t: number): string { let minute: number = Math.floor(t / 60) % 60 let m = minute < 10 ? '0' + minute : minute let second: number = t % 60 diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/utils/Logger.ts b/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/utils/Logger.ts index ce89b65d27ed50d0c6c65ab26c19fa2b2c89b880..1c03ba768c0d934308d4b8282207bbb18131d4a9 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/utils/Logger.ts +++ b/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/utils/Logger.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/utils/SaveCameraAsset.ets b/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/utils/SaveCameraAsset.ets index 1424c48de489b534abb781fe0225c3ccc2205f4a..d879751ceb23241d71f1b104faa507eb817c76c9 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/utils/SaveCameraAsset.ets +++ b/code/BasicFeature/Media/AVRecorder/entry/src/main/ets/utils/SaveCameraAsset.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,87 +13,57 @@ * limitations under the License. */ -import mediaLibrary from '@ohos.multimedia.mediaLibrary'; +import { common } from '@kit.AbilityKit'; +import { fileIo as fs } from '@kit.CoreFileKit'; import DateTimeUtil from './DateTimeUtils'; import Logger from './Logger'; export default class SaveCameraAsset { private tag: string - constructor(tag) { + constructor(tag: string) { this.tag = tag; } + private context = getContext(this) as common.UIAbilityContext; private lastSaveTime: string = ''; private saveIndex: number = 0; - public VideoPrepareFile: any; - public AudioPrepareFile: any; + public VideoPrepareFile?: fs.File; + public AudioPrepareFile?: fs.File; - public async createVideoFd(): Promise { + public async createVideoFd() { Logger.info(this.tag, 'get Recorder File Fd'); const mDateTimeUtil = new DateTimeUtil(); const displayName = this.checkName(`REC_${mDateTimeUtil.getDate()}_${mDateTimeUtil.getTime()}`) + '.mp4'; Logger.info(this.tag, 'get Recorder display name is: ' + displayName); - const media = mediaLibrary.getMediaLibrary(globalThis.abilityContext) - Logger.info(this.tag, 'get Recorder File Fd publicPath') - const fileKeyObj = mediaLibrary.FileKey; - const mediaType = mediaLibrary.MediaType.VIDEO; - let publicPath: string = await media.getPublicDirectory(mediaLibrary.DirectoryType.DIR_VIDEO); - Logger.info(this.tag, 'get Recorder File publicPath: ' + JSON.stringify(publicPath)); - try { - const dataUri = await media.createAsset(mediaType, displayName, publicPath); - Logger.info(this.tag, 'get Recorder dataUri is: ' + dataUri); - if (dataUri != undefined) { - Logger.info(this.tag, 'dataUri is undefined'); - const args = dataUri.id.toString(); - const fetchOp = { - selections: fileKeyObj.ID + "=?", - selectionArgs: [args], - } - Logger.info(this.tag, 'fetchOp= ' + JSON.stringify(fetchOp)) - const fetchFileResult = await media.getFileAssets(fetchOp); - Logger.info(this.tag, 'getFileAssets finished'); - this.VideoPrepareFile = await fetchFileResult.getFirstObject(); - const fdNumber = await this.VideoPrepareFile.open('rw'); - Logger.info(this.tag, 'get Recorder File fd is: ' + JSON.stringify(fdNumber)); - return fdNumber - } - } catch (err) { - Logger.error(this.tag, 'create Recorder File Fd ERROR: ' + err); + this.VideoPrepareFile = fs.openSync(this.context.filesDir + '/' + displayName, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); + let fdNumber: number = this.VideoPrepareFile.fd; + Logger.info(this.tag, 'get Recorder File fd is: ' + JSON.stringify(fdNumber)); + return fdNumber; + } + + public async closeVideoFile() { + if (this.VideoPrepareFile) { + await fs.close(this.VideoPrepareFile); + Logger.info(this.tag, 'close Video File end'); } } - public async createAudioFd(): Promise { + public async createAudioFd() { Logger.info(this.tag, 'get Recorder File Fd'); const mDateTimeUtil = new DateTimeUtil(); - const displayName = this.checkName(`REC_${mDateTimeUtil.getDate()}_${mDateTimeUtil.getTime()}`) + '.m4a'; + const displayName = this.checkName(`REC_${mDateTimeUtil.getDate()}_${mDateTimeUtil.getTime()}`) + '.wav'; Logger.info(this.tag, 'get Recorder display name is: ' + displayName); - const media = mediaLibrary.getMediaLibrary(globalThis.abilityContext) - Logger.info(this.tag, 'get Recorder File Fd publicPath') - const fileKeyObj = mediaLibrary.FileKey; - const mediaType = mediaLibrary.MediaType.AUDIO; - let publicPath: string = await media.getPublicDirectory(mediaLibrary.DirectoryType.DIR_AUDIO); - Logger.info(this.tag, 'get Recorder File publicPath: ' + JSON.stringify(publicPath)); - try { - const dataUri = await media.createAsset(mediaType, displayName, publicPath); - Logger.info(this.tag, 'get Recorder dataUri is: ' + dataUri); - if (dataUri != undefined) { - Logger.info(this.tag, 'dataUri is undefined'); - const args = dataUri.id.toString(); - const fetchOp = { - selections: fileKeyObj.ID + "=?", - selectionArgs: [args], - } - Logger.info(this.tag, 'fetchOp= ' + JSON.stringify(fetchOp)) - const fetchFileResult = await media.getFileAssets(fetchOp); - Logger.info(this.tag, 'getFileAssets finished'); - this.AudioPrepareFile = await fetchFileResult.getFirstObject(); - const fdNumber = await this.AudioPrepareFile.open('rw'); - Logger.info(this.tag, 'get Recorder File fd is: ' + JSON.stringify(fdNumber)); - return fdNumber - } - } catch (err) { - Logger.error(this.tag, 'create Recorder File Fd ERROR: ' + err); + this.AudioPrepareFile = fs.openSync(this.context.filesDir + '/' + displayName, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); + let fdNumber: number = this.AudioPrepareFile.fd; + Logger.info(this.tag, 'get Recorder File fd is: ' + JSON.stringify(fdNumber)); + return fdNumber; + } + + public async closeAudioFile() { + if (this.AudioPrepareFile) { + await fs.close(this.AudioPrepareFile); + Logger.info(this.tag, 'close Audio File end'); } } diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/main/module.json5 b/code/BasicFeature/Media/AVRecorder/entry/src/main/module.json5 index 8b325174f407aae7213916f094b86ad4187940e6..8b956593fc377858d97cc8771b88b1abe2c85855 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/main/module.json5 +++ b/code/BasicFeature/Media/AVRecorder/entry/src/main/module.json5 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -26,24 +26,59 @@ "metadata": [ { "name": "ArkTSPartialUpdate", - "value": "false" + "value": "true" } ], "requestPermissions": [ { - "name": "ohos.permission.MEDIA_LOCATION" + "name": "ohos.permission.MEDIA_LOCATION", + "reason": "$string:reason", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } }, { - "name": "ohos.permission.READ_MEDIA" + "name": "ohos.permission.READ_MEDIA", + "reason": "$string:reason", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } }, { - "name": "ohos.permission.WRITE_MEDIA" + "name": "ohos.permission.WRITE_MEDIA", + "reason": "$string:reason", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } }, { - "name": "ohos.permission.CAMERA" + "name": "ohos.permission.CAMERA", + "reason": "$string:reason", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } }, { - "name": "ohos.permission.MICROPHONE" + "name": "ohos.permission.MICROPHONE", + "reason": "$string:reason", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } } ], "deliveryWithInstall": true, @@ -52,7 +87,7 @@ "abilities": [ { "name": "EntryAbility", - "srcEntrance": "./ets/entryability/EntryAbility.ts", + "srcEntry": "./ets/entryability/EntryAbility.ts", "description": "$string:ability_desc", "icon": "$media:icon", "label": "$string:ability_label", diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/main/resources/base/element/string.json b/code/BasicFeature/Media/AVRecorder/entry/src/main/resources/base/element/string.json index 69dabb4be9e4caaa8b811127efaf6d32365f9718..9e1a2734c6e9a7b12234179b8e6f31cace15b954 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/main/resources/base/element/string.json +++ b/code/BasicFeature/Media/AVRecorder/entry/src/main/resources/base/element/string.json @@ -47,6 +47,10 @@ { "name": "video_resolution", "value": "video resolution: " + }, + { + "name": "reason", + "value": "Permission" } ] } \ No newline at end of file diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/main/resources/base/profile/main_pages.json b/code/BasicFeature/Media/AVRecorder/entry/src/main/resources/base/profile/main_pages.json index abe6e5e42de4523dbdbbd9024d7930d8dbe24708..657ac4c737d7bcf23747f681df12670b67b02625 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/main/resources/base/profile/main_pages.json +++ b/code/BasicFeature/Media/AVRecorder/entry/src/main/resources/base/profile/main_pages.json @@ -1,6 +1,7 @@ { "src": [ "pages/ListPage", - "recorder/AudioRecorder" + "recorder/AudioRecorder", + "recorder/VideoRecorder" ] } \ No newline at end of file diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/main/resources/en_US/element/string.json b/code/BasicFeature/Media/AVRecorder/entry/src/main/resources/en_US/element/string.json index 2d74b54a3625983830b2790997f1f372cecd430e..82319909d6ffb2b6dd7b0c440886113fba9a3eb0 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/main/resources/en_US/element/string.json +++ b/code/BasicFeature/Media/AVRecorder/entry/src/main/resources/en_US/element/string.json @@ -47,6 +47,10 @@ { "name": "video_resolution", "value": "video resolution: " + }, + { + "name": "reason", + "value": "Permission" } ] } \ No newline at end of file diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts index ca424c3f3b777ccc10a79f9e5f51da71cdffd7fb..c8c29d782589c43fd25c24c36d2aff035c067e90 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/test/Ability.test.ets b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/test/Ability.test.ets index 877c646c4bcf60462f8ec97100c35ebbf4f346fd..5fe584552493e85f44f091abacf35321b8b72f00 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/test/Ability.test.ets +++ b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/test/Ability.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,7 +15,6 @@ import { describe, it, expect } from '@ohos/hypium' import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; -// @ts-ignore import { Driver, ON } from '@ohos.UiTest'; import { logger } from '../util/Logger'; @@ -25,11 +24,11 @@ const driver = Driver.create(); const abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); export default function abilityTest() { - describe('ActsAbilityTest', function () { + describe('ActsAbilityTest', () => { /** * 拉起应用 */ - it(BUNDLE + '_StartAbility', 0, async function () { + it(BUNDLE + '_StartAbility', 0, async () => { logger.info(TAG, BUNDLE + '_StartAbility start'); let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); try { @@ -52,11 +51,11 @@ export default function abilityTest() { await driver.delayMs(1000); let ability = abilityDelegatorRegistry.getAppContext(); let manager = ability.resourceManager; - for (let i = 0; i < 4; i++) { + for (let i = 0; i < 3; i++) { let btnAccept = await driver.findComponent(ON.text(await manager.getStringValue($r('app.string.allow')))); if (btnAccept !== undefined) { await btnAccept.click(); - await driver.delayMs(500); + await driver.delayMs(1000); } } logger.info(TAG, BUNDLE + '_Permission end'); diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/test/List.test.ets b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/test/List.test.ets index b1c760a2d8f3ccaf4efcf47ebca336a80e24793f..5d378e9388f7cda84903ce7d4428e94916451f57 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/test/List.test.ets +++ b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/test/List.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/testability/TestAbility.ets b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/testability/TestAbility.ets index fbb5f33b6d586810b71af5f902cb77a2e0e69f7c..176298c220c5429a65b283d9a0e7e36050a3f804 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/testability/TestAbility.ets +++ b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/testability/TestAbility.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,7 +15,9 @@ import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; import testsuite from '../test/List.test'; -import UIAbility from '@ohos.app.ability.UIAbility'; +import { UIAbility } from '@kit.AbilityKit'; +import { Want } from '@kit.AbilityKit'; +import { AbilityConstant } from '@kit.AbilityKit'; import window from '@ohos.window'; import { Hypium } from '@ohos/hypium'; import { logger } from '../util/Logger'; @@ -23,7 +25,7 @@ import { logger } from '../util/Logger'; const TAG: string = 'TestAbility'; export default class TestAbility extends UIAbility { - onCreate(want, launchParam): void { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { logger.info(TAG, `TestAbility onCreate, want param: ${JSON.stringify(want)},launchParam: ${JSON.stringify(launchParam)}`); let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); let abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/testability/pages/Index.ets b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/testability/pages/Index.ets index 47d1e59fd7e989e23956aaf64c6ad737266c6b59..9cafd637bac759380726e37e36db7f69cedcfed7 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/testability/pages/Index.ets +++ b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/testability/pages/Index.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/util/Logger.ts b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/util/Logger.ts index 226758dba6a84773150b722e134938e264d93eba..b22b75f71586480a61a3c50b6d5a40512f4f62f5 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/util/Logger.ts +++ b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/ets/util/Logger.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/module.json5 b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/module.json5 index 8a6e31af9ab8f60cc26e9a9f1774769cf6e7a644..802fe37b304605737495bf4328a859488867625e 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/module.json5 +++ b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/module.json5 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -26,24 +26,59 @@ "metadata": [ { "name": "ArkTSPartialUpdate", - "value": "false" + "value": "true" } ], "requestPermissions": [ { - "name": "ohos.permission.MEDIA_LOCATION" + "name": "ohos.permission.MEDIA_LOCATION", + "reason": "$string:reason", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } }, { - "name": "ohos.permission.READ_MEDIA" + "name": "ohos.permission.READ_MEDIA", + "reason": "$string:reason", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } }, { - "name": "ohos.permission.WRITE_MEDIA" + "name": "ohos.permission.WRITE_MEDIA", + "reason": "$string:reason", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } }, { - "name": "ohos.permission.CAMERA" + "name": "ohos.permission.CAMERA", + "reason": "$string:reason", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } }, { - "name": "ohos.permission.MICROPHONE" + "name": "ohos.permission.MICROPHONE", + "reason": "$string:reason", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } } ], "deliveryWithInstall": true, @@ -52,7 +87,7 @@ "abilities": [ { "name": "TestAbility", - "srcEntrance": "./ets/testability/TestAbility.ets", + "srcEntry": "./ets/testability/TestAbility.ets", "description": "$string:TestAbility_desc", "icon": "$media:icon", "label": "$string:TestAbility_label", diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/resources/base/element/string.json b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/resources/base/element/string.json index b9f92cd5a7677bfe8f75fd3306267a098e46ea51..05f54e9677e7260c7af72e9815ae6336058d40fd 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/resources/base/element/string.json +++ b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/resources/base/element/string.json @@ -15,6 +15,10 @@ { "name": "allow", "value": "allow" + }, + { + "name": "reason", + "value": "Permission" } ] } \ No newline at end of file diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/resources/en_US/element/string.json b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/resources/en_US/element/string.json index b9f92cd5a7677bfe8f75fd3306267a098e46ea51..05f54e9677e7260c7af72e9815ae6336058d40fd 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/resources/en_US/element/string.json +++ b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/resources/en_US/element/string.json @@ -15,6 +15,10 @@ { "name": "allow", "value": "allow" + }, + { + "name": "reason", + "value": "Permission" } ] } \ No newline at end of file diff --git a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/resources/zh_CN/element/string.json b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/resources/zh_CN/element/string.json index 5b5d59386d35b09f7f8e6fb89a3edfd6a6c10af3..f4381a8bb2f70004379c98ede3e2b43c648c386a 100644 --- a/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/resources/zh_CN/element/string.json +++ b/code/BasicFeature/Media/AVRecorder/entry/src/ohosTest/resources/zh_CN/element/string.json @@ -15,6 +15,10 @@ { "name": "allow", "value": "允许" + }, + { + "name": "reason", + "value": "权限" } ] } \ No newline at end of file diff --git a/code/BasicFeature/Media/AVRecorder/hvigor/hvigor-config.json5 b/code/BasicFeature/Media/AVRecorder/hvigor/hvigor-config.json5 index 6839e0815bf2deb94021b0ecff3c6f0df8e5961f..b702b54eb8a903887efd99b76740ccb6f550ef60 100644 --- a/code/BasicFeature/Media/AVRecorder/hvigor/hvigor-config.json5 +++ b/code/BasicFeature/Media/AVRecorder/hvigor/hvigor-config.json5 @@ -1,5 +1,5 @@ /* -* Copyright (C) 2023 Huawei Device Co., Ltd. +* Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,8 +14,10 @@ */ { - "hvigorVersion": "2.0.0", + "modelVersion": "5.0.0", "dependencies": { - "@ohos/hvigor-ohos-plugin": "2.0.0" + }, + "debugging": { + "stacktrace": true } -} +} \ No newline at end of file diff --git a/code/BasicFeature/Media/AVRecorder/hvigor/hvigor-wrapper.js b/code/BasicFeature/Media/AVRecorder/hvigor/hvigor-wrapper.js deleted file mode 100644 index 994f22987bd0739b9faa07c966b066c2d9218602..0000000000000000000000000000000000000000 --- a/code/BasicFeature/Media/AVRecorder/hvigor/hvigor-wrapper.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";var e=require("fs"),t=require("path"),n=require("os"),r=require("crypto"),u=require("child_process"),o=require("constants"),i=require("stream"),s=require("util"),c=require("assert"),a=require("tty"),l=require("zlib"),f=require("net");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var D=d(e),p=d(t),E=d(n),m=d(r),h=d(u),y=d(o),C=d(i),F=d(s),g=d(c),A=d(a),v=d(l),S=d(f),w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},O={},b={},_={},B=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_,"__esModule",{value:!0}),_.isMac=_.isLinux=_.isWindows=void 0;const P=B(E.default),k="Windows_NT",x="Linux",N="Darwin";_.isWindows=function(){return P.default.type()===k},_.isLinux=function(){return P.default.type()===x},_.isMac=function(){return P.default.type()===N};var I={},T=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),R=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),M=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&T(t,e,n);return R(t,e),t};Object.defineProperty(I,"__esModule",{value:!0}),I.hash=void 0;const L=M(m.default);I.hash=function(e,t="md5"){return L.createHash(t).update(e,"utf-8").digest("hex")},function(e){var t=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.HVIGOR_BOOT_JS_FILE_PATH=e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=e.HVIGOR_PROJECT_DEPENDENCIES_HOME=e.HVIGOR_PROJECT_WRAPPER_HOME=e.HVIGOR_PROJECT_NAME=e.HVIGOR_PROJECT_ROOT_DIR=e.HVIGOR_PROJECT_CACHES_HOME=e.HVIGOR_PNPM_STORE_PATH=e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=e.HVIGOR_WRAPPER_TOOLS_HOME=e.HVIGOR_USER_HOME=e.DEFAULT_PACKAGE_JSON=e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=e.PNPM=e.HVIGOR=e.NPM_TOOL=e.PNPM_TOOL=e.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const u=r(p.default),o=r(E.default),i=_,s=I;e.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",e.PNPM_TOOL=(0,i.isWindows)()?"pnpm.cmd":"pnpm",e.NPM_TOOL=(0,i.isWindows)()?"npm.cmd":"npm",e.HVIGOR="hvigor",e.PNPM="pnpm",e.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",e.DEFAULT_PACKAGE_JSON="package.json",e.HVIGOR_USER_HOME=u.resolve(o.homedir(),".hvigor"),e.HVIGOR_WRAPPER_TOOLS_HOME=u.resolve(e.HVIGOR_USER_HOME,"wrapper","tools"),e.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH=u.resolve(e.HVIGOR_WRAPPER_TOOLS_HOME,"node_modules",".bin",e.PNPM_TOOL),e.HVIGOR_PNPM_STORE_PATH=u.resolve(e.HVIGOR_USER_HOME,"caches"),e.HVIGOR_PROJECT_CACHES_HOME=u.resolve(e.HVIGOR_USER_HOME,"project_caches"),e.HVIGOR_PROJECT_ROOT_DIR=process.cwd(),e.HVIGOR_PROJECT_NAME=u.basename((0,s.hash)(e.HVIGOR_PROJECT_ROOT_DIR)),e.HVIGOR_PROJECT_WRAPPER_HOME=u.resolve(e.HVIGOR_PROJECT_ROOT_DIR,e.HVIGOR),e.HVIGOR_PROJECT_DEPENDENCIES_HOME=u.resolve(e.HVIGOR_PROJECT_CACHES_HOME,e.HVIGOR_PROJECT_NAME,"workspace"),e.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,e.DEFAULT_PACKAGE_JSON),e.HVIGOR_BOOT_JS_FILE_PATH=u.resolve(e.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js")}(b);var j={},$={};Object.defineProperty($,"__esModule",{value:!0}),$.logInfoPrintConsole=$.logErrorAndExit=void 0,$.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},$.logInfoPrintConsole=function(e){console.log(e)};var H=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),J=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),G=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&H(t,e,n);return J(t,e),t},V=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(j,"__esModule",{value:!0}),j.isFileExists=j.offlinePluginConversion=j.executeCommand=j.getNpmPath=j.hasNpmPackInPaths=void 0;const U=h.default,W=G(p.default),z=b,K=$,q=V(D.default);j.hasNpmPackInPaths=function(e,t){try{return require.resolve(e,{paths:[...t]}),!0}catch(e){return!1}},j.getNpmPath=function(){const e=process.execPath;return W.join(W.dirname(e),z.NPM_TOOL)},j.executeCommand=function(e,t,n){0!==(0,U.spawnSync)(e,t,n).status&&(0,K.logErrorAndExit)(`Error: ${e} ${t} execute failed.See above for details.`)},j.offlinePluginConversion=function(e,t){return t.startsWith("file:")||t.endsWith(".tgz")?W.resolve(e,z.HVIGOR,t.replace("file:","")):t},j.isFileExists=function(e){return q.default.existsSync(e)&&q.default.statSync(e).isFile()},function(e){var t=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var u in e)"default"!==u&&Object.prototype.hasOwnProperty.call(e,u)&&t(r,e,u);return n(r,e),r},u=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.executeInstallPnpm=e.isPnpmAvailable=e.environmentHandler=e.checkNpmConifg=e.PNPM_VERSION=void 0;const o=r(D.default),i=b,s=j,c=r(p.default),a=$,l=h.default,f=u(E.default);e.PNPM_VERSION="7.30.0",e.checkNpmConifg=function(){const e=c.resolve(i.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),t=c.resolve(f.default.homedir(),".npmrc");if((0,s.isFileExists)(e)||(0,s.isFileExists)(t))return;const n=(0,s.getNpmPath)(),r=(0,l.spawnSync)(n,["config","get","prefix"],{cwd:i.HVIGOR_PROJECT_ROOT_DIR});if(0!==r.status||!r.stdout)return void(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const u=c.resolve(`${r.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,s.isFileExists)(u)||(0,a.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},e.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},e.isPnpmAvailable=function(){return!!o.existsSync(i.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,s.hasNpmPackInPaths)("pnpm",[i.HVIGOR_WRAPPER_TOOLS_HOME])},e.executeInstallPnpm=function(){(0,a.logInfoPrintConsole)(`Installing pnpm@${e.PNPM_VERSION}...`);const t=(0,s.getNpmPath)();!function(){const t=c.resolve(i.HVIGOR_WRAPPER_TOOLS_HOME,i.DEFAULT_PACKAGE_JSON);try{o.existsSync(i.HVIGOR_WRAPPER_TOOLS_HOME)||o.mkdirSync(i.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const n={dependencies:{}};n.dependencies[i.PNPM]=e.PNPM_VERSION,o.writeFileSync(t,JSON.stringify(n))}catch(e){(0,a.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${t} failed.`)}}(),(0,s.executeCommand)(t,["install","pnpm"],{cwd:i.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,a.logInfoPrintConsole)("Pnpm install success.")}}(O);var Y={},X={},Z={},Q={};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Unicode=void 0;class ee{}Q.Unicode=ee,ee.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ee.ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ee.ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Object.defineProperty(Z,"__esModule",{value:!0}),Z.JudgeUtil=void 0;const te=Q;Z.JudgeUtil=class{static isIgnoreChar(e){return"string"==typeof e&&("\t"===e||"\v"===e||"\f"===e||" "===e||" "===e||"\ufeff"===e||"\n"===e||"\r"===e||"\u2028"===e||"\u2029"===e)}static isSpaceSeparator(e){return"string"==typeof e&&te.Unicode.Space_Separator.test(e)}static isIdStartChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||te.Unicode.ID_Start.test(e))}static isIdContinueChar(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||"‌"===e||"‍"===e||te.Unicode.ID_Continue.test(e))}static isDigitWithoutZero(e){return/[1-9]/.test(e)}static isDigit(e){return"string"==typeof e&&/[0-9]/.test(e)}static isHexDigit(e){return"string"==typeof e&&/[0-9A-Fa-f]/.test(e)}};var ne={},re={fromCallback:function(e){return Object.defineProperty((function(...t){if("function"!=typeof t[t.length-1])return new Promise(((n,r)=>{e.call(this,...t,((e,t)=>null!=e?r(e):n(t)))}));e.apply(this,t)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);e.apply(this,t.slice(0,-1)).then((e=>n(null,e)),n)}),"name",{value:e.name})}},ue=y.default,oe=process.cwd,ie=null,se=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return ie||(ie=oe.call(process)),ie};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var ce=process.chdir;process.chdir=function(e){ie=null,ce.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ce)}var ae=function(e){ue.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,ue.O_WRONLY|ue.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,ue.O_WRONLY|ue.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){ue.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,ue.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,ue.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===se&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var le=C.default.Stream,fe=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);le.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;ithis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);le.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var de=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:De(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},De=Object.getPrototypeOf||function(e){return e.__proto__};var pe,Ee,me=D.default,he=ae,ye=fe,Ce=de,Fe=F.default;function ge(e,t){Object.defineProperty(e,pe,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(pe=Symbol.for("graceful-fs.queue"),Ee=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",Ee="___graceful-fs.previous");var Ae=function(){};if(Fe.debuglog?Ae=Fe.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ae=function(){var e=Fe.format.apply(Fe,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!me[pe]){var ve=w[pe]||[];ge(me,ve),me.close=function(e){function t(t,n){return e.call(me,t,(function(e){e||_e(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Ee,{value:e}),t}(me.close),me.closeSync=function(e){function t(t){e.apply(me,arguments),_e()}return Object.defineProperty(t,Ee,{value:e}),t}(me.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Ae(me[pe]),g.default.equal(me[pe].length,0)}))}w[pe]||ge(w,me[pe]);var Se,we=Oe(Ce(me));function Oe(e){he(e),e.gracefulify=Oe,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):be([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):be([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):be([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=ye(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;E(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;E(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function E(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):be([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=E,e}function be(e){Ae("ENQUEUE",e[0].name,e[1]),me[pe].push(e),Be()}function _e(){for(var e=Date.now(),t=0;t2&&(me[pe][t][3]=e,me[pe][t][4]=e);Be()}function Be(){if(clearTimeout(Se),Se=void 0,0!==me[pe].length){var e=me[pe].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)Ae("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){Ae("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(Ae("RETRY",t.name,n),t.apply(null,n.concat([u]))):me[pe].push(e)}void 0===Se&&(Se=setTimeout(Be,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!me.__patched&&(we=Oe(me),me.__patched=!0),function(e){const t=re.fromCallback,n=we,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.assign(e,n),r.forEach((r=>{e[r]=t(n[r])})),e.realpath.native=t(n.realpath.native),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.writev&&(e.writev=function(e,t,...r){return"function"==typeof r[r.length-1]?n.writev(e,t,...r):new Promise(((u,o)=>{n.writev(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffers:n})}))}))})}(ne);var Pe={},ke={};const xe=p.default;ke.checkPath=function(e){if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(xe.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}};const Ne=ne,{checkPath:Ie}=ke,Te=e=>"number"==typeof e?e:{mode:511,...e}.mode;Pe.makeDir=async(e,t)=>(Ie(e),Ne.mkdir(e,{mode:Te(t),recursive:!0})),Pe.makeDirSync=(e,t)=>(Ie(e),Ne.mkdirSync(e,{mode:Te(t),recursive:!0}));const Re=re.fromPromise,{makeDir:Me,makeDirSync:Le}=Pe,je=Re(Me);var $e={mkdirs:je,mkdirsSync:Le,mkdirp:je,mkdirpSync:Le,ensureDir:je,ensureDirSync:Le};const He=re.fromPromise,Je=ne;var Ge={pathExists:He((function(e){return Je.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:Je.existsSync};const Ve=we;var Ue=function(e,t,n,r){Ve.open(e,"r+",((e,u)=>{if(e)return r(e);Ve.futimes(u,t,n,(e=>{Ve.close(u,(t=>{r&&r(e||t)}))}))}))},We=function(e,t,n){const r=Ve.openSync(e,"r+");return Ve.futimesSync(r,t,n),Ve.closeSync(r)};const ze=ne,Ke=p.default,qe=F.default;function Ye(e,t,n){const r=n.dereference?e=>ze.stat(e,{bigint:!0}):e=>ze.lstat(e,{bigint:!0});return Promise.all([r(e),r(t).catch((e=>{if("ENOENT"===e.code)return null;throw e}))]).then((([e,t])=>({srcStat:e,destStat:t})))}function Xe(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function Ze(e,t){const n=Ke.resolve(e).split(Ke.sep).filter((e=>e)),r=Ke.resolve(t).split(Ke.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Qe(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var et={checkPaths:function(e,t,n,r,u){qe.callbackify(Ye)(e,t,r,((r,o)=>{if(r)return u(r);const{srcStat:i,destStat:s}=o;if(s){if(Xe(i,s)){const r=Ke.basename(e),o=Ke.basename(t);return"move"===n&&r!==o&&r.toLowerCase()===o.toLowerCase()?u(null,{srcStat:i,destStat:s,isChangingCase:!0}):u(new Error("Source and destination must not be the same."))}if(i.isDirectory()&&!s.isDirectory())return u(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!i.isDirectory()&&s.isDirectory())return u(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return i.isDirectory()&&Ze(e,t)?u(new Error(Qe(e,t,n))):u(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n,r){const{srcStat:u,destStat:o}=function(e,t,n){let r;const u=n.dereference?e=>ze.statSync(e,{bigint:!0}):e=>ze.lstatSync(e,{bigint:!0}),o=u(e);try{r=u(t)}catch(e){if("ENOENT"===e.code)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:r}}(e,t,r);if(o){if(Xe(u,o)){const r=Ke.basename(e),i=Ke.basename(t);if("move"===n&&r!==i&&r.toLowerCase()===i.toLowerCase())return{srcStat:u,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(u.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!u.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(u.isDirectory()&&Ze(e,t))throw new Error(Qe(e,t,n));return{srcStat:u,destStat:o}},checkParentPaths:function e(t,n,r,u,o){const i=Ke.resolve(Ke.dirname(t)),s=Ke.resolve(Ke.dirname(r));if(s===i||s===Ke.parse(s).root)return o();ze.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):Xe(n,c)?o(new Error(Qe(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Ke.resolve(Ke.dirname(t)),i=Ke.resolve(Ke.dirname(r));if(i===o||i===Ke.parse(i).root)return;let s;try{s=ze.statSync(i,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(Xe(n,s))throw new Error(Qe(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ze,areIdentical:Xe};const tt=we,nt=p.default,rt=$e.mkdirs,ut=Ge.pathExists,ot=Ue,it=et;function st(e,t,n,r,u){const o=nt.dirname(n);ut(o,((i,s)=>i?u(i):s?at(e,t,n,r,u):void rt(o,(o=>o?u(o):at(e,t,n,r,u)))))}function ct(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function at(e,t,n,r,u){(r.dereference?tt.stat:tt.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){return t?Dt(n,r,u,o):function(e,t,n,r,u){tt.mkdir(n,(o=>{if(o)return u(o);Dt(t,n,r,(t=>t?u(t):dt(n,e,u)))}))}(e.mode,n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();tt.unlink(n,(o=>o?u(o):lt(e,t,n,r,u)))}(e,n,r,u,o):lt(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){tt.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=nt.resolve(process.cwd(),o)),e?void tt.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?tt.symlink(o,n,u):u(t):(r.dereference&&(i=nt.resolve(process.cwd(),i)),it.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&it.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){tt.unlink(t,(r=>r?n(r):tt.symlink(e,t,n)))}(o,n,u)))):tt.symlink(o,n,u))))}(e,t,n,r,u):i.isSocket()?u(new Error(`Cannot copy a socket file: ${t}`)):i.isFIFO()?u(new Error(`Cannot copy a FIFO pipe: ${t}`)):u(new Error(`Unknown file: ${t}`))))}function lt(e,t,n,r,u){tt.copyFile(t,n,(o=>o?u(o):r.preserveTimestamps?function(e,t,n,r){if(function(e){return 0==(128&e)}(e))return function(e,t,n){return dt(e,128|t,n)}(n,e,(u=>u?r(u):ft(e,t,n,r)));return ft(e,t,n,r)}(e.mode,t,n,u):dt(n,e.mode,u)))}function ft(e,t,n,r){!function(e,t,n){tt.stat(e,((e,r)=>e?n(e):ot(t,r.atime,r.mtime,n)))}(t,n,(t=>t?r(t):dt(n,e,r)))}function dt(e,t,n){return tt.chmod(e,t,n)}function Dt(e,t,n,r){tt.readdir(e,((u,o)=>u?r(u):pt(o,e,t,n,r)))}function pt(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=nt.join(n,t),s=nt.join(r,t);it.checkPaths(i,s,"copy",u,((t,c)=>{if(t)return o(t);const{destStat:a}=c;!function(e,t,n,r,u){r.filter?ct(at,e,t,n,r,u):at(e,t,n,r,u)}(a,i,s,u,(t=>t?o(t):pt(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Et=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),it.checkPaths(e,t,"copy",n,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;it.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ct(st,s,e,t,n,r):st(s,e,t,n,r)))}))};const mt=we,ht=p.default,yt=$e.mkdirsSync,Ct=We,Ft=et;function gt(e,t,n,r){const u=(r.dereference?mt.statSync:mt.lstatSync)(t);if(u.isDirectory())return function(e,t,n,r,u){return t?St(n,r,u):function(e,t,n,r){return mt.mkdirSync(n),St(t,n,r),vt(n,e)}(e.mode,n,r,u)}(u,e,t,n,r);if(u.isFile()||u.isCharacterDevice()||u.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return mt.unlinkSync(n),At(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):At(e,n,r,u)}(u,e,t,n,r);if(u.isSymbolicLink())return function(e,t,n,r){let u=mt.readlinkSync(t);r.dereference&&(u=ht.resolve(process.cwd(),u));if(e){let e;try{e=mt.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return mt.symlinkSync(u,n);throw e}if(r.dereference&&(e=ht.resolve(process.cwd(),e)),Ft.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(mt.statSync(n).isDirectory()&&Ft.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return mt.unlinkSync(t),mt.symlinkSync(e,t)}(u,n)}return mt.symlinkSync(u,n)}(e,t,n,r);if(u.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(u.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function At(e,t,n,r){return mt.copyFileSync(t,n),r.preserveTimestamps&&function(e,t,n){(function(e){return 0==(128&e)})(e)&&function(e,t){vt(e,128|t)}(n,e);(function(e,t){const n=mt.statSync(e);Ct(t,n.atime,n.mtime)})(t,n)}(e.mode,t,n),vt(n,e.mode)}function vt(e,t){return mt.chmodSync(e,t)}function St(e,t,n){mt.readdirSync(e).forEach((r=>function(e,t,n,r){const u=ht.join(t,e),o=ht.join(n,e),{destStat:i}=Ft.checkPathsSync(u,o,"copy",r);return function(e,t,n,r){if(!r.filter||r.filter(t,n))return gt(e,t,n,r)}(i,u,o,r)}(r,e,t,n)))}var wt=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Ft.checkPathsSync(e,t,"copy",n);return Ft.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ht.dirname(n);mt.existsSync(u)||yt(u);return gt(e,t,n,r)}(u,e,t,n)};var Ot={copy:(0,re.fromCallback)(Et),copySync:wt};const bt=we,_t=p.default,Bt=g.default,Pt="win32"===process.platform;function kt(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||bt[t],e[t+="Sync"]=e[t]||bt[t]})),e.maxBusyTries=e.maxBusyTries||3}function xt(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt.strictEqual(typeof n,"function","rimraf: callback function required"),Bt(t,"rimraf: invalid options argument provided"),Bt.strictEqual(typeof t,"object","rimraf: options should be object"),kt(t),Nt(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rNt(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Nt(e,t,n){Bt(e),Bt(t),Bt("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Pt?It(e,t,r,n):u&&u.isDirectory()?Rt(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Pt?It(e,t,r,n):Rt(e,t,r,n);if("EISDIR"===r.code)return Rt(e,t,r,n)}return n(r)}))))}function It(e,t,n,r){Bt(e),Bt(t),Bt("function"==typeof r),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Rt(e,t,n,r):t.unlink(e,r)}))}))}function Tt(e,t,n){let r;Bt(e),Bt(t);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Lt(e,t,n):t.unlinkSync(e)}function Rt(e,t,n,r){Bt(e),Bt(t),Bt("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){Bt(e),Bt(t),Bt("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{xt(_t.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Mt(e,t){let n;kt(t=t||{}),Bt(e,"rimraf: missing path"),Bt.strictEqual(typeof e,"string","rimraf: path should be a string"),Bt(t,"rimraf: missing options"),Bt.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Pt&&Tt(e,t,n)}try{n&&n.isDirectory()?Lt(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Pt?Tt(e,t,n):Lt(e,t,n);if("EISDIR"!==n.code)throw n;Lt(e,t,n)}}function Lt(e,t,n){Bt(e),Bt(t);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(Bt(e),Bt(t),t.readdirSync(e).forEach((n=>Mt(_t.join(e,n),t))),!Pt){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch{}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var jt=xt;xt.sync=Mt;const $t=we,Ht=re.fromCallback,Jt=jt;var Gt={remove:Ht((function(e,t){if($t.rm)return $t.rm(e,{recursive:!0,force:!0},t);Jt(e,t)})),removeSync:function(e){if($t.rmSync)return $t.rmSync(e,{recursive:!0,force:!0});Jt.sync(e)}};const Vt=re.fromPromise,Ut=ne,Wt=p.default,zt=$e,Kt=Gt,qt=Vt((async function(e){let t;try{t=await Ut.readdir(e)}catch{return zt.mkdirs(e)}return Promise.all(t.map((t=>Kt.remove(Wt.join(e,t)))))}));function Yt(e){let t;try{t=Ut.readdirSync(e)}catch{return zt.mkdirsSync(e)}t.forEach((t=>{t=Wt.join(e,t),Kt.removeSync(t)}))}var Xt={emptyDirSync:Yt,emptydirSync:Yt,emptyDir:qt,emptydir:qt};const Zt=re.fromCallback,Qt=p.default,en=we,tn=$e;var nn={createFile:Zt((function(e,t){function n(){en.writeFile(e,"",(e=>{if(e)return t(e);t()}))}en.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Qt.dirname(e);en.stat(o,((e,r)=>{if(e)return"ENOENT"===e.code?tn.mkdirs(o,(e=>{if(e)return t(e);n()})):t(e);r.isDirectory()?n():en.readdir(o,(e=>{if(e)return t(e)}))}))}))})),createFileSync:function(e){let t;try{t=en.statSync(e)}catch{}if(t&&t.isFile())return;const n=Qt.dirname(e);try{en.statSync(n).isDirectory()||en.readdirSync(n)}catch(e){if(!e||"ENOENT"!==e.code)throw e;tn.mkdirsSync(n)}en.writeFileSync(e,"")}};const rn=re.fromCallback,un=p.default,on=we,sn=$e,cn=Ge.pathExists,{areIdentical:an}=et;var ln={createLink:rn((function(e,t,n){function r(e,t){on.link(e,t,(e=>{if(e)return n(e);n(null)}))}on.lstat(t,((u,o)=>{on.lstat(e,((u,i)=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);if(o&&an(i,o))return n(null);const s=un.dirname(t);cn(s,((u,o)=>u?n(u):o?r(e,t):void sn.mkdirs(s,(u=>{if(u)return n(u);r(e,t)}))))}))}))})),createLinkSync:function(e,t){let n;try{n=on.lstatSync(t)}catch{}try{const t=on.lstatSync(e);if(n&&an(t,n))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const r=un.dirname(t);return on.existsSync(r)||sn.mkdirsSync(r),on.linkSync(e,t)}};const fn=p.default,dn=we,Dn=Ge.pathExists;var pn={symlinkPaths:function(e,t,n){if(fn.isAbsolute(e))return dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=fn.dirname(t),u=fn.join(r,e);return Dn(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):dn.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:fn.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(fn.isAbsolute(e)){if(n=dn.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=fn.dirname(t),u=fn.join(r,e);if(n=dn.existsSync(u),n)return{toCwd:u,toDst:e};if(n=dn.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:fn.relative(r,e)}}}};const En=we;var mn={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);En.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=En.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}};const hn=re.fromCallback,yn=p.default,Cn=ne,Fn=$e.mkdirs,gn=$e.mkdirsSync,An=pn.symlinkPaths,vn=pn.symlinkPathsSync,Sn=mn.symlinkType,wn=mn.symlinkTypeSync,On=Ge.pathExists,{areIdentical:bn}=et;function _n(e,t,n,r){An(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,Sn(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=yn.dirname(t);On(o,((n,i)=>n?r(n):i?Cn.symlink(e,t,u,r):void Fn(o,(n=>{if(n)return r(n);Cn.symlink(e,t,u,r)}))))}))}))}var Bn={createSymlink:hn((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Cn.lstat(t,((u,o)=>{!u&&o.isSymbolicLink()?Promise.all([Cn.stat(e),Cn.stat(t)]).then((([u,o])=>{if(bn(u,o))return r(null);_n(e,t,n,r)})):_n(e,t,n,r)}))})),createSymlinkSync:function(e,t,n){let r;try{r=Cn.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){const n=Cn.statSync(e),r=Cn.statSync(t);if(bn(n,r))return}const u=vn(e,t);e=u.toDst,n=wn(u.toCwd,n);const o=yn.dirname(t);return Cn.existsSync(o)||gn(o),Cn.symlinkSync(e,t,n)}};const{createFile:Pn,createFileSync:kn}=nn,{createLink:xn,createLinkSync:Nn}=ln,{createSymlink:In,createSymlinkSync:Tn}=Bn;var Rn={createFile:Pn,createFileSync:kn,ensureFile:Pn,ensureFileSync:kn,createLink:xn,createLinkSync:Nn,ensureLink:xn,ensureLinkSync:Nn,createSymlink:In,createSymlinkSync:Tn,ensureSymlink:In,ensureSymlinkSync:Tn};var Mn={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:u}={}){const o=n?t:"";return JSON.stringify(e,r,u).replace(/\n/g,t)+o},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}};let Ln;try{Ln=we}catch(e){Ln=D.default}const jn=re,{stringify:$n,stripBom:Hn}=Mn;const Jn=jn.fromPromise((async function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;let u,o=await jn.fromCallback(n.readFile)(e,t);o=Hn(o);try{u=JSON.parse(o,t?t.reviver:null)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}return u}));const Gn=jn.fromPromise((async function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);await jn.fromCallback(r.writeFile)(e,u,n)}));const Vn={readFile:Jn,readFileSync:function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Ln,r=!("throws"in t)||t.throws;try{let r=n.readFileSync(e,t);return r=Hn(r),JSON.parse(r,t.reviver)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}},writeFile:Gn,writeFileSync:function(e,t,n={}){const r=n.fs||Ln,u=$n(t,n);return r.writeFileSync(e,u,n)}};var Un={readJson:Vn.readFile,readJsonSync:Vn.readFileSync,writeJson:Vn.writeFile,writeJsonSync:Vn.writeFileSync};const Wn=re.fromCallback,zn=we,Kn=p.default,qn=$e,Yn=Ge.pathExists;var Xn={outputFile:Wn((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Kn.dirname(e);Yn(u,((o,i)=>o?r(o):i?zn.writeFile(e,t,n,r):void qn.mkdirs(u,(u=>{if(u)return r(u);zn.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Kn.dirname(e);if(zn.existsSync(n))return zn.writeFileSync(e,...t);qn.mkdirsSync(n),zn.writeFileSync(e,...t)}};const{stringify:Zn}=Mn,{outputFile:Qn}=Xn;var er=async function(e,t,n={}){const r=Zn(t,n);await Qn(e,r,n)};const{stringify:tr}=Mn,{outputFileSync:nr}=Xn;var rr=function(e,t,n){const r=tr(t,n);nr(e,r,n)};const ur=re.fromPromise,or=Un;or.outputJson=ur(er),or.outputJsonSync=rr,or.outputJSON=or.outputJson,or.outputJSONSync=or.outputJsonSync,or.writeJSON=or.writeJson,or.writeJSONSync=or.writeJsonSync,or.readJSON=or.readJson,or.readJSONSync=or.readJsonSync;var ir=or;const sr=we,cr=p.default,ar=Ot.copy,lr=Gt.remove,fr=$e.mkdirp,dr=Ge.pathExists,Dr=et;function pr(e,t,n,r,u){return r?Er(e,t,n,u):n?lr(t,(r=>r?u(r):Er(e,t,n,u))):void dr(t,((r,o)=>r?u(r):o?u(new Error("dest already exists.")):Er(e,t,n,u)))}function Er(e,t,n,r){sr.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};ar(e,t,u,(t=>t?r(t):lr(e,r)))}(e,t,n,r):r()))}var mr=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Dr.checkPaths(e,t,"move",n,((n,o)=>{if(n)return r(n);const{srcStat:i,isChangingCase:s=!1}=o;Dr.checkParentPaths(e,i,t,"move",(n=>n?r(n):function(e){const t=cr.dirname(e);return cr.parse(t).root===t}(t)?pr(e,t,u,s,r):void fr(cr.dirname(t),(n=>n?r(n):pr(e,t,u,s,r)))))}))};const hr=we,yr=p.default,Cr=Ot.copySync,Fr=Gt.removeSync,gr=$e.mkdirpSync,Ar=et;function vr(e,t,n){try{hr.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Cr(e,t,r),Fr(e)}(e,t,n)}}var Sr=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u,isChangingCase:o=!1}=Ar.checkPathsSync(e,t,"move",n);return Ar.checkParentPathsSync(e,u,t,"move"),function(e){const t=yr.dirname(e);return yr.parse(t).root===t}(t)||gr(yr.dirname(t)),function(e,t,n,r){if(r)return vr(e,t,n);if(n)return Fr(t),vr(e,t,n);if(hr.existsSync(t))throw new Error("dest already exists.");return vr(e,t,n)}(e,t,r,o)};var wr,Or,br,_r,Br,Pr={move:(0,re.fromCallback)(mr),moveSync:Sr},kr={...ne,...Ot,...Xt,...Rn,...ir,...$e,...Pr,...Xn,...Ge,...Gt},xr={},Nr={exports:{}},Ir={exports:{}};function Tr(){if(Or)return wr;Or=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return wr=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function Rr(){if(_r)return br;return _r=1,br=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=function(){if($r)return jr;$r=1;const e=E.default,t=A.default,n=Vr(),{env:r}=process;let u;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function i(t,o){if(0===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!o&&void 0===u)return 0;const i=u||0;if("dumb"===r.TERM)return i;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in r))||"codeship"===r.CI_NAME?1:i;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:i}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?u=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=1),"FORCE_COLOR"in r&&(u="true"===r.FORCE_COLOR?1:"false"===r.FORCE_COLOR?0:0===r.FORCE_COLOR.length?1:Math.min(parseInt(r.FORCE_COLOR,10),3)),jr={supportsColor:function(e){return o(i(e,e&&e.isTTY))},stdout:o(i(!0,t.isatty(1))),stderr:o(i(!0,t.isatty(2)))}}();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=Rr()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(Gr,Gr.exports)),Gr.exports}Jr=Nr,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Jr.exports=(Br||(Br=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Rr()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Ir,Ir.exports)),Ir.exports):Jr.exports=Ur();var Wr=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=zr(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i!e,Qr=e=>e&&"object"==typeof e&&!Array.isArray(e),eu=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${Kr.inspect(e,{depth:5})}) - ${n}`)}))};var tu={configure:e=>{qr("New configuration to be validated: ",e),eu(e,Zr(Qr(e)),"must be an object."),qr(`Calling pre-processing listeners (${Yr.length})`),Yr.forEach((t=>t(e))),qr("Configuration pre-processing finished."),qr(`Calling configuration listeners (${Xr.length})`),Xr.forEach((t=>t(e))),qr("Configuration finished.")},addListener:e=>{Xr.push(e),qr(`Added listener, now ${Xr.length} listeners`)},addPreProcessingListener:e=>{Yr.push(e),qr(`Added pre-processing listener, now ${Yr.length} listeners`)},throwExceptionIf:eu,anObject:Qr,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:Zr},nu={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(nu);const ru=nu.exports,uu=E.default,ou=F.default,iu=p.default,su={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function cu(e){return e?`[${su[e][0]}m`:""}function au(e){return e?`[${su[e][1]}m`:""}function lu(e,t){return n=ou.format("[%s] [%s] %s - ",ru.asString(e.startTime),e.level.toString(),e.categoryName),cu(r=t)+n+au(r);var n,r}function fu(e){return lu(e)+ou.format(...e.data)}function du(e){return lu(e,e.level.colour)+ou.format(...e.data)}function Du(e){return ou.format(...e.data)}function pu(e){return e.data[0]}function Eu(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflos%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");ee&&(n=r.slice(-e).join(iu.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.substr(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.substr(1),10);t.lengthDu,basic:()=>fu,colored:()=>du,coloured:()=>du,pattern:e=>Eu(e&&e.pattern,e&&e.tokens),dummy:()=>pu};var hu={basicLayout:fu,messagePassThroughLayout:Du,patternLayout:Eu,colouredLayout:du,coloredLayout:du,dummyLayout:pu,addLayout(e,t){mu[e]=t},layout:(e,t)=>mu[e]&&mu[e](t)};const yu=tu,Cu=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Fu{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Fu?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Fu[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Fu[n]=new Fu(e[t].value,n,e[t].colour);const r=Fu.levels.findIndex((e=>e.levelStr===n));r>-1?Fu.levels[r]=Fu[n]:Fu.levels.push(Fu[n])})),Fu.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Fu.getLevel(e)),this.level===e.level}}Fu.levels=[],Fu.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),yu.addListener((e=>{const t=e.levels;if(t){yu.throwExceptionIf(e,yu.not(yu.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{yu.throwExceptionIf(e,yu.not(yu.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),yu.throwExceptionIf(e,yu.not(yu.anObject(t[n])),`level "${n}" must be an object`),yu.throwExceptionIf(e,yu.not(t[n].value),`level "${n}" must have a 'value' property`),yu.throwExceptionIf(e,yu.not(yu.anInteger(t[n].value)),`level "${n}".value must have an integer value`),yu.throwExceptionIf(e,yu.not(t[n].colour),`level "${n}" must have a 'colour' property`),yu.throwExceptionIf(e,yu.not(Cu.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${Cu.join(", ")}`)}))}})),yu.addListener((e=>{Fu.addLevels(e.levels)}));var gu=Fu,Au={exports:{}},vu={};/*! (c) 2020 Andrea Giammarchi */ -const{parse:Su,stringify:wu}=JSON,{keys:Ou}=Object,bu=String,_u="string",Bu={},Pu="object",ku=(e,t)=>t,xu=e=>e instanceof bu?bu(e):e,Nu=(e,t)=>typeof t===_u?new bu(t):t,Iu=(e,t,n,r)=>{const u=[];for(let o=Ou(n),{length:i}=o,s=0;s{const r=bu(t.push(n)-1);return e.set(n,r),r},Ru=(e,t)=>{const n=Su(e,Nu).map(xu),r=n[0],u=t||ku,o=typeof r===Pu&&r?Iu(n,new Set,r,u):r;return u.call({"":o},"",o)};vu.parse=Ru;const Mu=(e,t,n)=>{const r=t&&typeof t===Pu?(e,n)=>""===e||-1Su(Mu(e));vu.fromJSON=e=>Ru(wu(e));const Lu=vu,ju=gu;class $u{constructor(e,t,n,r,u){this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,u&&(this.functionName=u.functionName,this.fileName=u.fileName,this.lineNumber=u.lineNumber,this.columnNumber=u.columnNumber,this.callStack=u.callStack)}serialise(){const e=this.data.map((e=>(e&&e.message&&e.stack&&(e=Object.assign({message:e.message,stack:e.stack},e)),e)));return this.data=e,Lu.stringify(this)}static deserialise(e){let t;try{const n=Lu.parse(e);n.data=n.data.map((e=>{if(e&&e.message&&e.stack){const t=new Error(e);Object.keys(e).forEach((n=>{t[n]=e[n]})),e=t}return e})),t=new $u(n.categoryName,ju.getLevel(n.level.levelStr),n.data,n.context),t.startTime=new Date(n.startTime),t.pid=n.pid,t.cluster=n.cluster}catch(n){t=new $u("log4js",ju.ERROR,["Unable to parse log:",e,"because: ",n])}return t}}var Hu=$u;const Ju=Nr.exports("log4js:clustering"),Gu=Hu,Vu=tu;let Uu=!1,Wu=null;try{Wu=require("cluster")}catch(e){Ju("cluster module not present"),Uu=!0}const zu=[];let Ku=!1,qu="NODE_APP_INSTANCE";const Yu=()=>Ku&&"0"===process.env[qu],Xu=()=>Uu||Wu.isMaster||Yu(),Zu=e=>{zu.forEach((t=>t(e)))},Qu=(e,t)=>{if(Ju("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){Ju("received message: ",t.data);const e=Gu.deserialise(t.data);Zu(e)}};Uu||Vu.addListener((e=>{zu.length=0,({pm2:Ku,disableClustering:Uu,pm2InstanceVar:qu="NODE_APP_INSTANCE"}=e),Ju(`clustering disabled ? ${Uu}`),Ju(`cluster.isMaster ? ${Wu&&Wu.isMaster}`),Ju(`pm2 enabled ? ${Ku}`),Ju(`pm2InstanceVar = ${qu}`),Ju(`process.env[${qu}] = ${process.env[qu]}`),Ku&&process.removeListener("message",Qu),Wu&&Wu.removeListener&&Wu.removeListener("message",Qu),Uu||e.disableClustering?Ju("Not listening for cluster messages, because clustering disabled."):Yu()?(Ju("listening for PM2 broadcast messages"),process.on("message",Qu)):Wu.isMaster?(Ju("listening for cluster messages"),Wu.on("message",Qu)):Ju("not listening for messages, because we are not a master process")}));var eo={onlyOnMaster:(e,t)=>Xu()?e():t,isMaster:Xu,send:e=>{Xu()?Zu(e):(Ku||(e.cluster={workerId:Wu.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{zu.push(e)}},to={};function no(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.substr(e.length-1).toLocaleUpperCase(),u=e.substring(0,e.length-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function ro(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:no},e)}const uo={file:ro,fileSync:ro};to.modifyConfig=e=>uo[e.type]?uo[e.type](e):e;var oo={};const io=console.log.bind(console);oo.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{io(e(n,t))}}(n,e.timezoneOffset)};var so={};so.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var co={};co.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var ao={};ao.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;t.isGreaterThanOrEqualTo(u)&&t.isLessThanOrEqualTo(o)&&n(e)}}(e.level,e.maxLevel,u,r)};var lo={};const fo=Nr.exports("log4js:categoryFilter");lo.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{fo(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(fo("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Do={};const po=Nr.exports("log4js:noLogFilter");Do.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{po(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(po("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var Eo={},mo={exports:{}},ho={},yo={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}};!function(e){const t=yo.fromCallback,n=we,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(ho);const Co=p.default;function Fo(e){return(e=Co.normalize(Co.resolve(e)).split(Co.sep)).length>0?e[0]:null}const go=/[<>:"|?*]/;var Ao=function(e){const t=Fo(e);return e=e.replace(t,""),go.test(e)};const vo=we,So=p.default,wo=Ao,Oo=parseInt("0777",8);var bo=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&wo(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||vo;void 0===o&&(o=Oo&~process.umask()),u||(u=null),r=r||function(){},t=So.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(So.dirname(t)===t)return r(o);e(So.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const _o=we,Bo=p.default,Po=Ao,ko=parseInt("0777",8);var xo=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||_o;if("win32"===process.platform&&Po(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=ko&~process.umask()),r||(r=null),t=Bo.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(Bo.dirname(t)===t)throw u;r=e(Bo.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const No=(0,yo.fromCallback)(bo);var Io={mkdirs:No,mkdirsSync:xo,mkdirp:No,mkdirpSync:xo,ensureDir:No,ensureDirSync:xo};const To=we;E.default,p.default;var Ro=function(e,t,n,r){To.open(e,"r+",((e,u)=>{if(e)return r(e);To.futimes(u,t,n,(e=>{To.close(u,(t=>{r&&r(e||t)}))}))}))},Mo=function(e,t,n){const r=To.openSync(e,"r+");return To.futimesSync(r,t,n),To.closeSync(r)};const Lo=we,jo=p.default,$o=10,Ho=5,Jo=0,Go=process.versions.node.split("."),Vo=Number.parseInt(Go[0],10),Uo=Number.parseInt(Go[1],10),Wo=Number.parseInt(Go[2],10);function zo(){if(Vo>$o)return!0;if(Vo===$o){if(Uo>Ho)return!0;if(Uo===Ho&&Wo>=Jo)return!0}return!1}function Ko(e,t){const n=jo.resolve(e).split(jo.sep).filter((e=>e)),r=jo.resolve(t).split(jo.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function qo(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Yo,Xo,Zo={checkPaths:function(e,t,n,r){!function(e,t,n){zo()?Lo.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);Lo.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):Lo.stat(e,((e,r)=>{if(e)return n(e);Lo.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&Ko(e,t)?r(new Error(qo(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=zo()?Lo.statSync(e,{bigint:!0}):Lo.statSync(e);try{r=zo()?Lo.statSync(t,{bigint:!0}):Lo.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&Ko(e,t))throw new Error(qo(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=jo.resolve(jo.dirname(t)),s=jo.resolve(jo.dirname(r));if(s===i||s===jo.parse(s).root)return o();zo()?Lo.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o))):Lo.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(qo(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=jo.resolve(jo.dirname(t)),i=jo.resolve(jo.dirname(r));if(i===o||i===jo.parse(i).root)return;let s;try{s=zo()?Lo.statSync(i,{bigint:!0}):Lo.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(qo(t,r,u));return e(t,n,i,u)},isSrcSubdir:Ko};const Qo=we,ei=p.default,ti=Io.mkdirsSync,ni=Mo,ri=Zo;function ui(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Qo.statSync:Qo.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Qo.mkdirSync(n),ii(t,n,r),Qo.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return ii(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Qo.unlinkSync(n),oi(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):oi(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Qo.readlinkSync(t);r.dereference&&(u=ei.resolve(process.cwd(),u));if(e){let e;try{e=Qo.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Qo.symlinkSync(u,n);throw e}if(r.dereference&&(e=ei.resolve(process.cwd(),e)),ri.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Qo.statSync(n).isDirectory()&&ri.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Qo.unlinkSync(t),Qo.symlinkSync(e,t)}(u,n)}return Qo.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function oi(e,t,n,r){return"function"==typeof Qo.copyFileSync?(Qo.copyFileSync(t,n),Qo.chmodSync(n,e.mode),r.preserveTimestamps?ni(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Xo?Yo:(Xo=1,Yo=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Qo.openSync(t,"r"),s=Qo.openSync(n,"w",e.mode);let c=0;for(;cfunction(e,t,n,r){const u=ei.join(t,e),o=ei.join(n,e),{destStat:i}=ri.checkPathsSync(u,o,"copy");return ui(i,u,o,r)}(r,e,t,n)))}var si=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=ri.checkPathsSync(e,t,"copy");return ri.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=ei.dirname(n);Qo.existsSync(u)||ti(u);return ui(e,t,n,r)}(u,e,t,n)},ci={copySync:si};const ai=yo.fromPromise,li=ho;var fi={pathExists:ai((function(e){return li.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:li.existsSync};const di=we,Di=p.default,pi=Io.mkdirs,Ei=fi.pathExists,mi=Ro,hi=Zo;function yi(e,t,n,r,u){const o=Di.dirname(n);Ei(o,((i,s)=>i?u(i):s?Fi(e,t,n,r,u):void pi(o,(o=>o?u(o):Fi(e,t,n,r,u)))))}function Ci(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function Fi(e,t,n,r,u){return r.filter?Ci(gi,e,t,n,r,u):gi(e,t,n,r,u)}function gi(e,t,n,r,u){(r.dereference?di.stat:di.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){di.mkdir(n,(o=>{if(o)return u(o);Si(t,n,r,(t=>t?u(t):di.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return Si(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();di.unlink(n,(o=>o?u(o):Ai(e,t,n,r,u)))}(e,n,r,u,o):Ai(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){di.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Di.resolve(process.cwd(),o)),e?void di.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?di.symlink(o,n,u):u(t):(r.dereference&&(i=Di.resolve(process.cwd(),i)),hi.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&hi.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){di.unlink(t,(r=>r?n(r):di.symlink(e,t,n)))}(o,n,u)))):di.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function Ai(e,t,n,r,u){return"function"==typeof di.copyFile?di.copyFile(t,n,(t=>t?u(t):vi(e,n,r,u))):function(e,t,n,r,u){const o=di.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=di.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>vi(e,n,r,u)))}))}(e,t,n,r,u)}function vi(e,t,n,r){di.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?mi(t,e.atime,e.mtime,r):r()))}function Si(e,t,n,r){di.readdir(e,((u,o)=>u?r(u):wi(o,e,t,n,r)))}function wi(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Di.join(n,t),s=Di.join(r,t);hi.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;Fi(a,i,s,u,(t=>t?o(t):wi(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var Oi=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),hi.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;hi.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?Ci(yi,s,e,t,n,r):yi(s,e,t,n,r)))}))};var bi={copy:(0,yo.fromCallback)(Oi)};const _i=we,Bi=p.default,Pi=g.default,ki="win32"===process.platform;function xi(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||_i[t],e[t+="Sync"]=e[t]||_i[t]})),e.maxBusyTries=e.maxBusyTries||3}function Ni(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi.strictEqual(typeof n,"function","rimraf: callback function required"),Pi(t,"rimraf: invalid options argument provided"),Pi.strictEqual(typeof t,"object","rimraf: options should be object"),xi(t),Ii(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&rIi(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Ii(e,t,n){Pi(e),Pi(t),Pi("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&ki?Ti(e,t,r,n):u&&u.isDirectory()?Mi(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return ki?Ti(e,t,r,n):Mi(e,t,r,n);if("EISDIR"===r.code)return Mi(e,t,r,n)}return n(r)}))))}function Ti(e,t,n,r){Pi(e),Pi(t),Pi("function"==typeof r),n&&Pi(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Mi(e,t,n,r):t.unlink(e,r)}))}))}function Ri(e,t,n){let r;Pi(e),Pi(t),n&&Pi(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?ji(e,t,n):t.unlinkSync(e)}function Mi(e,t,n,r){Pi(e),Pi(t),n&&Pi(n instanceof Error),Pi("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){Pi(e),Pi(t),Pi("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{Ni(Bi.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function Li(e,t){let n;xi(t=t||{}),Pi(e,"rimraf: missing path"),Pi.strictEqual(typeof e,"string","rimraf: path should be a string"),Pi(t,"rimraf: missing options"),Pi.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&ki&&Ri(e,t,n)}try{n&&n.isDirectory()?ji(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return ki?Ri(e,t,n):ji(e,t,n);if("EISDIR"!==n.code)throw n;ji(e,t,n)}}function ji(e,t,n){Pi(e),Pi(t),n&&Pi(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(Pi(e),Pi(t),t.readdirSync(e).forEach((n=>Li(Bi.join(e,n),t))),!ki){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var $i=Ni;Ni.sync=Li;const Hi=$i;var Ji={remove:(0,yo.fromCallback)(Hi),removeSync:Hi.sync};const Gi=yo.fromCallback,Vi=we,Ui=p.default,Wi=Io,zi=Ji,Ki=Gi((function(e,t){t=t||function(){},Vi.readdir(e,((n,r)=>{if(n)return Wi.mkdirs(e,t);r=r.map((t=>Ui.join(e,t))),function e(){const n=r.pop();if(!n)return t();zi.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function qi(e){let t;try{t=Vi.readdirSync(e)}catch(t){return Wi.mkdirsSync(e)}t.forEach((t=>{t=Ui.join(e,t),zi.removeSync(t)}))}var Yi={emptyDirSync:qi,emptydirSync:qi,emptyDir:Ki,emptydir:Ki};const Xi=yo.fromCallback,Zi=p.default,Qi=we,es=Io,ts=fi.pathExists;var ns={createFile:Xi((function(e,t){function n(){Qi.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Qi.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Zi.dirname(e);ts(o,((e,r)=>e?t(e):r?n():void es.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Qi.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Zi.dirname(e);Qi.existsSync(n)||es.mkdirsSync(n),Qi.writeFileSync(e,"")}};const rs=yo.fromCallback,us=p.default,os=we,is=Io,ss=fi.pathExists;var cs={createLink:rs((function(e,t,n){function r(e,t){os.link(e,t,(e=>{if(e)return n(e);n(null)}))}ss(t,((u,o)=>u?n(u):o?n(null):void os.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=us.dirname(t);ss(o,((u,i)=>u?n(u):i?r(e,t):void is.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(os.existsSync(t))return;try{os.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=us.dirname(t);return os.existsSync(n)||is.mkdirsSync(n),os.linkSync(e,t)}};const as=p.default,ls=we,fs=fi.pathExists;var ds={symlinkPaths:function(e,t,n){if(as.isAbsolute(e))return ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=as.dirname(t),u=as.join(r,e);return fs(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):ls.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:as.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(as.isAbsolute(e)){if(n=ls.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=as.dirname(t),u=as.join(r,e);if(n=ls.existsSync(u),n)return{toCwd:u,toDst:e};if(n=ls.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:as.relative(r,e)}}}};const Ds=we;var ps={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Ds.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Ds.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const Es=yo.fromCallback,ms=p.default,hs=we,ys=Io.mkdirs,Cs=Io.mkdirsSync,Fs=ds.symlinkPaths,gs=ds.symlinkPathsSync,As=ps.symlinkType,vs=ps.symlinkTypeSync,Ss=fi.pathExists;var ws={createSymlink:Es((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Ss(t,((u,o)=>u?r(u):o?r(null):void Fs(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,As(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=ms.dirname(t);Ss(o,((n,i)=>n?r(n):i?hs.symlink(e,t,u,r):void ys(o,(n=>{if(n)return r(n);hs.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(hs.existsSync(t))return;const r=gs(e,t);e=r.toDst,n=vs(r.toCwd,n);const u=ms.dirname(t);return hs.existsSync(u)||Cs(u),hs.symlinkSync(e,t,n)}};var Os,bs={createFile:ns.createFile,createFileSync:ns.createFileSync,ensureFile:ns.createFile,ensureFileSync:ns.createFileSync,createLink:cs.createLink,createLinkSync:cs.createLinkSync,ensureLink:cs.createLink,ensureLinkSync:cs.createLinkSync,createSymlink:ws.createSymlink,createSymlinkSync:ws.createSymlinkSync,ensureSymlink:ws.createSymlink,ensureSymlinkSync:ws.createSymlinkSync};try{Os=we}catch(e){Os=D.default}function _s(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function Bs(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var Ps={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||Os,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=Bs(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||Os,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=Bs(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||Os,o="";try{o=_s(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||Os,u=_s(t,n);return r.writeFileSync(e,u,n)}},ks=Ps;const xs=yo.fromCallback,Ns=ks;var Is={readJson:xs(Ns.readFile),readJsonSync:Ns.readFileSync,writeJson:xs(Ns.writeFile),writeJsonSync:Ns.writeFileSync};const Ts=p.default,Rs=Io,Ms=fi.pathExists,Ls=Is;var js=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Ts.dirname(e);Ms(u,((o,i)=>o?r(o):i?Ls.writeJson(e,t,n,r):void Rs.mkdirs(u,(u=>{if(u)return r(u);Ls.writeJson(e,t,n,r)}))))};const $s=we,Hs=p.default,Js=Io,Gs=Is;var Vs=function(e,t,n){const r=Hs.dirname(e);$s.existsSync(r)||Js.mkdirsSync(r),Gs.writeJsonSync(e,t,n)};const Us=yo.fromCallback,Ws=Is;Ws.outputJson=Us(js),Ws.outputJsonSync=Vs,Ws.outputJSON=Ws.outputJson,Ws.outputJSONSync=Ws.outputJsonSync,Ws.writeJSON=Ws.writeJson,Ws.writeJSONSync=Ws.writeJsonSync,Ws.readJSON=Ws.readJson,Ws.readJSONSync=Ws.readJsonSync;var zs=Ws;const Ks=we,qs=p.default,Ys=ci.copySync,Xs=Ji.removeSync,Zs=Io.mkdirpSync,Qs=Zo;function ec(e,t,n){try{Ks.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ys(e,t,r),Xs(e)}(e,t,n)}}var tc=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Qs.checkPathsSync(e,t,"move");return Qs.checkParentPathsSync(e,u,t,"move"),Zs(qs.dirname(t)),function(e,t,n){if(n)return Xs(t),ec(e,t,n);if(Ks.existsSync(t))throw new Error("dest already exists.");return ec(e,t,n)}(e,t,r)},nc={moveSync:tc};const rc=we,uc=p.default,oc=bi.copy,ic=Ji.remove,sc=Io.mkdirp,cc=fi.pathExists,ac=Zo;function lc(e,t,n,r){rc.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};oc(e,t,u,(t=>t?r(t):ic(e,r)))}(e,t,n,r):r()))}var fc=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;ac.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;ac.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);sc(uc.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return ic(t,(u=>u?r(u):lc(e,t,n,r)));cc(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):lc(e,t,n,r)))}(e,t,u,r)))}))}))};var dc={move:(0,yo.fromCallback)(fc)};const Dc=yo.fromCallback,pc=we,Ec=p.default,mc=Io,hc=fi.pathExists;var yc={outputFile:Dc((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=Ec.dirname(e);hc(u,((o,i)=>o?r(o):i?pc.writeFile(e,t,n,r):void mc.mkdirs(u,(u=>{if(u)return r(u);pc.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=Ec.dirname(e);if(pc.existsSync(n))return pc.writeFileSync(e,...t);mc.mkdirsSync(n),pc.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},ho,ci,bi,Yi,bs,zs,Io,nc,dc,yc,fi,Ji);const t=D.default;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(mo);const Cc=Nr.exports("streamroller:fileNameFormatter"),Fc=p.default;const gc=Nr.exports("streamroller:fileNameParser"),Ac=nu.exports;const vc=Nr.exports("streamroller:moveAndMaybeCompressFile"),Sc=mo.exports,wc=v.default;var Oc=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return vc(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await Sc.pathExists(e))if(vc(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=Sc.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=Sc.createReadStream(e).on("open",(()=>{t.pipe(wc.createGzip()).pipe(i)})).on("error",(t=>{vc(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{vc(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),Sc.unlink(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),Sc.truncate(e).then(r).catch((t=>{vc(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(vc(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),Sc.unlink(t).then((()=>{u(e)})).catch((e=>{vc(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(vc(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{vc(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await Sc.move(e,t,{overwrite:!0})}catch(n){if(vc(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){vc("moveAndMaybeCompressFile: trying copy+truncate instead");try{await Sc.copy(e,t,{overwrite:!0}),await Sc.truncate(e)}catch(e){vc("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else vc("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const bc=Nr.exports("streamroller:RollingFileWriteStream"),_c=mo.exports,Bc=p.default,Pc=E.default,kc=()=>new Date,xc=nu.exports,{Writable:Nc}=C.default,Ic=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=Fc.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(Cc(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},Tc=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(gc("it is gzipped"),t.isCompressed=!0,e.slice(0,-1*".gz".length)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(gc("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(gc("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];gc("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),gc(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=Ac.parse(n,i,new Date(0,0));return Ac.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return gc(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(gc("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Rc=Oc;var Mc=class extends Nc{constructor(e,t){if(bc(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(Bc.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${Bc.sep}`)&&(e=e.replace("~",Pc.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=Bc.parse(e),""===this.fileObject.dir&&(this.fileObject=Bc.parse(Bc.join(process.cwd(),e))),this.fileFormatter=Ic({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return bc(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{bc(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(bc(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==xc(this.options.pattern,kc())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return bc("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){bc(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Rc(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?xc(this.options.pattern,kc()):null,bc(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await _c.readdir(this.fileObject.dir).catch((()=>[]));bc(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:kc().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return _c.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(Bc.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(_c.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;_c.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=_c.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await this._getExistingFiles();if(bc(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${e.length}`),bc("_clean: existing files are: ",e),this._tooManyFiles(e.length)){const n=e.slice(0,e.length-this.options.numToKeep).map((e=>Bc.format({dir:this.fileObject.dir,base:e.filename})));await(t=n,bc(`deleteFiles: files to delete: ${t}`),Promise.all(t.map((e=>_c.unlink(e).catch((t=>{bc(`deleteFiles: error when unlinking ${e}, ignoring. Error was ${t}`)}))))))}var t}_tooManyFiles(e){return this.options.numToKeep>0&&e>this.options.numToKeep}};const Lc=Mc;var jc=class extends Lc{constructor(e,t,n,r){r||(r={}),t&&(r.maxSize=t),r.numBackups||0===r.numBackups||(n||0===n||(n=1),r.numBackups=n),super(e,r),this.backups=r.numBackups,this.size=this.options.maxSize}get theStream(){return this.currentFileStream}};const $c=Mc;var Hc={RollingFileWriteStream:Mc,RollingFileStream:jc,DateRollingFileStream:class extends $c{constructor(e,t,n){t&&"object"==typeof t&&(n=t,t=null),n||(n={}),t||(t="yyyy-MM-dd"),n.pattern=t,n.numBackups||0===n.numBackups?n.daysToKeep=n.numBackups:(n.daysToKeep||0===n.daysToKeep?process.emitWarning("options.daysToKeep is deprecated due to the confusion it causes when used together with file size rolling. Please use options.numBackups instead.","DeprecationWarning","streamroller-DEP0001"):n.daysToKeep=1,n.numBackups=n.daysToKeep),super(e,n),this.mode=this.options.mode}get theStream(){return this.currentFileStream}}};const Jc=Nr.exports("log4js:file"),Gc=p.default,Vc=Hc,Uc=E.default.EOL;let Wc=!1;const zc=new Set;function Kc(){zc.forEach((e=>{e.sighupHandler()}))}function qc(e,t,n,r){const u=new Vc.RollingFileStream(e,t,n,r);return u.on("error",(t=>{console.error("log4js.fileAppender - Writing to file %s, error happened ",e,t)})),u.on("drain",(()=>{process.emit("log4js:pause",!1)})),u}Eo.configure=function(e,t){let n=t.basicLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),e.mode=e.mode||384,function(e,t,n,r,u,o){e=Gc.normalize(e),Jc("Creating file appender (",e,", ",n,", ",r=r||0===r?r:5,", ",u,", ",o,")");let i=qc(e,n,r,u);const s=function(e){if(i.writable){if(!0===u.removeColor){const t=/\x1b[[0-9;]*m/g;e.data=e.data.map((e=>"string"==typeof e?e.replace(t,""):e))}i.write(t(e,o)+Uc,"utf8")||process.emit("log4js:pause",!0)}};return s.reopen=function(){i.end((()=>{i=qc(e,n,r,u)}))},s.sighupHandler=function(){Jc("SIGHUP handler called."),s.reopen()},s.shutdown=function(e){zc.delete(s),0===zc.size&&Wc&&(process.removeListener("SIGHUP",Kc),Wc=!1),i.end("","utf-8",e)},zc.add(s),Wc||(process.on("SIGHUP",Kc),Wc=!0),s}(e.filename,n,e.maxLogSize,e.backups,e,e.timezoneOffset)};var Yc={};const Xc=Hc,Zc=E.default.EOL;function Qc(e,t,n,r,u){r.maxSize=r.maxLogSize;const o=function(e,t,n){const r=new Xc.DateRollingFileStream(e,t,n);return r.on("error",(t=>{console.error("log4js.dateFileAppender - Writing to file %s, error happened ",e,t)})),r.on("drain",(()=>{process.emit("log4js:pause",!1)})),r}(e,t,r),i=function(e){o.writable&&(o.write(n(e,u)+Zc,"utf8")||process.emit("log4js:pause",!0))};return i.shutdown=function(e){o.end("","utf-8",e)},i}Yc.configure=function(e,t){let n=t.basicLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),e.alwaysIncludePattern||(e.alwaysIncludePattern=!1),e.mode=e.mode||384,Qc(e.filename,e.pattern,n,e,e.timezoneOffset)};var ea={};const ta=Nr.exports("log4js:fileSync"),na=p.default,ra=D.default,ua=E.default.EOL||"\n";function oa(e,t){if(ra.existsSync(e))return;const n=ra.openSync(e,t.flags,t.mode);ra.closeSync(n)}class ia{constructor(e,t,n,r){ta("In RollingFileStream"),function(){if(!e||!t||t<=0)throw new Error("You must specify a filename and file size")}(),this.filename=e,this.size=t,this.backups=n,this.options=r,this.currentSize=0,this.currentSize=function(e){let t=0;try{t=ra.statSync(e).size}catch(t){oa(e,r)}return t}(this.filename)}shouldRoll(){return ta("should roll with current size %d, and max size %d",this.currentSize,this.size),this.currentSize>=this.size}roll(e){const t=this,n=new RegExp(`^${na.basename(e)}`);function r(e){return n.test(e)}function u(t){return parseInt(t.substring(`${na.basename(e)}.`.length),10)||0}function o(e,t){return u(e)>u(t)?1:u(e) ${e}.${r+1}`),ra.renameSync(na.join(na.dirname(e),n),`${e}.${r+1}`)}}ta("Rolling, rolling, rolling"),ta("Renaming the old files"),ra.readdirSync(na.dirname(e)).filter(r).sort(o).reverse().forEach(i)}write(e,t){const n=this;ta("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),ta("writing the chunk to the file"),n.currentSize+=e.length,ra.appendFileSync(n.filename,e)}}ea.configure=function(e,t){let n=t.basicLayout;e.layout&&(n=t.layout(e.layout.type,e.layout));const r={flags:e.flags||"a",encoding:e.encoding||"utf8",mode:e.mode||384};return function(e,t,n,r,u,o){ta("fileSync appender created");const i=function(e,t,n){let r;var u;return t?r=new ia(e,t,n,o):(oa(u=e,o),r={write(e){ra.appendFileSync(u,e)}}),r}(e=na.normalize(e),n,r=r||0===r?r:5);return e=>{i.write(t(e,u)+ua)}}(e.filename,n,e.maxLogSize,e.backups,e.timezoneOffset,r)};var sa={};const ca=Nr.exports("log4js:tcp"),aa=S.default;sa.configure=function(e,t){ca(`configure with config = ${e}`);let n=function(e){return e.serialise()};return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){let n=!1;const r=[];let u,o=3,i="__LOG4JS__";function s(e){ca("Writing log event to socket"),n=u.write(`${t(e)}${i}`,"utf8")}function c(){let e;for(ca("emptying buffer");e=r.shift();)s(e)}function a(e){n?s(e):(ca("buffering log event because it cannot write at the moment"),r.push(e))}return function t(){ca(`appender creating socket to ${e.host||"localhost"}:${e.port||5e3}`),i=`${e.endMsg||"__LOG4JS__"}`,u=aa.createConnection(e.port||5e3,e.host||"localhost"),u.on("connect",(()=>{ca("socket connected"),c(),n=!0})),u.on("drain",(()=>{ca("drain event received, emptying buffer"),n=!0,c()})),u.on("timeout",u.end.bind(u)),u.on("error",(e=>{ca("connection error",e),n=!1,c()})),u.on("close",t)}(),a.shutdown=function(e){ca("shutdown called"),r.length&&o?(ca("buffer has items, waiting 100ms to empty"),o-=1,setTimeout((()=>{a.shutdown(e)}),100)):(u.removeAllListeners("close"),u.end(e))},a}(e,n)};const la=p.default,fa=Nr.exports("log4js:appenders"),da=tu,Da=eo,pa=gu,Ea=hu,ma=to,ha=new Map;ha.set("console",oo),ha.set("stdout",so),ha.set("stderr",co),ha.set("logLevelFilter",ao),ha.set("categoryFilter",lo),ha.set("noLogFilter",Do),ha.set("file",Eo),ha.set("dateFile",Yc),ha.set("fileSync",ea),ha.set("tcp",sa);const ya=new Map,Ca=(e,t)=>{fa("Loading module from ",e);try{return require(e)}catch(n){return void da.throwExceptionIf(t,"MODULE_NOT_FOUND"!==n.code,`appender "${e}" could not be loaded (error was: ${n})`)}},Fa=new Set,ga=(e,t)=>{if(ya.has(e))return ya.get(e);if(!t.appenders[e])return!1;if(Fa.has(e))throw new Error(`Dependency loop detected for appender ${e}.`);Fa.add(e),fa(`Creating appender ${e}`);const n=Aa(e,t);return Fa.delete(e),ya.set(e,n),n},Aa=(e,t)=>{const n=t.appenders[e],r=n.type.configure?n.type:((e,t)=>ha.get(e)||Ca(`./${e}`,t)||Ca(e,t)||require.main&&Ca(la.join(la.dirname(require.main.filename),e),t)||Ca(la.join(process.cwd(),e),t))(n.type,t);return da.throwExceptionIf(t,da.not(r),`appender "${e}" is not valid (type "${n.type}" could not be found)`),r.appender&&fa(`DEPRECATION: Appender ${n.type} exports an appender function.`),r.shutdown&&fa(`DEPRECATION: Appender ${n.type} exports a shutdown function.`),fa(`${e}: clustering.isMaster ? ${Da.isMaster()}`),fa(`${e}: appenderModule is ${F.default.inspect(r)}`),Da.onlyOnMaster((()=>(fa(`calling appenderModule.configure for ${e} / ${n.type}`),r.configure(ma.modifyConfig(n),Ea,(e=>ga(e,t)),pa))),(()=>{}))},va=e=>{ya.clear(),Fa.clear();const t=[];Object.values(e.categories).forEach((e=>{t.push(...e.appenders)})),Object.keys(e.appenders).forEach((n=>{(t.includes(n)||"tcp-server"===e.appenders[n].type)&&ga(n,e)}))},Sa=()=>{va({appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"trace"}}})};Sa(),da.addListener((e=>{da.throwExceptionIf(e,da.not(da.anObject(e.appenders)),'must have a property "appenders" of type object.');const t=Object.keys(e.appenders);da.throwExceptionIf(e,da.not(t.length),"must define at least one appender."),t.forEach((t=>{da.throwExceptionIf(e,da.not(e.appenders[t].type),`appender "${t}" is not valid (must be an object with property "type")`)}))})),da.addListener(va),Au.exports=ya,Au.exports.init=Sa;var wa={exports:{}};!function(e){const t=Nr.exports("log4js:categories"),n=tu,r=gu,u=Au.exports,o=new Map;function i(e,t,n){if(!1===t.inherit)return;const r=n.lastIndexOf(".");if(r<0)return;const u=n.substring(0,r);let o=e.categories[u];o||(o={inherit:!0,appenders:[]}),i(e,o,u),!e.categories[u]&&o.appenders&&o.appenders.length&&o.level&&(e.categories[u]=o),t.appenders=t.appenders||[],t.level=t.level||o.level,o.appenders.forEach((e=>{t.appenders.includes(e)||t.appenders.push(e)})),t.parent=o}function s(e){if(!e.categories)return;Object.keys(e.categories).forEach((t=>{const n=e.categories[t];i(e,n,t)}))}n.addPreProcessingListener((e=>s(e))),n.addListener((e=>{n.throwExceptionIf(e,n.not(n.anObject(e.categories)),'must have a property "categories" of type object.');const t=Object.keys(e.categories);n.throwExceptionIf(e,n.not(t.length),"must define at least one category."),t.forEach((t=>{const o=e.categories[t];n.throwExceptionIf(e,[n.not(o.appenders),n.not(o.level)],`category "${t}" is not valid (must be an object with properties "appenders" and "level")`),n.throwExceptionIf(e,n.not(Array.isArray(o.appenders)),`category "${t}" is not valid (appenders must be an array of appender names)`),n.throwExceptionIf(e,n.not(o.appenders.length),`category "${t}" is not valid (appenders must contain at least one appender name)`),Object.prototype.hasOwnProperty.call(o,"enableCallStack")&&n.throwExceptionIf(e,"boolean"!=typeof o.enableCallStack,`category "${t}" is not valid (enableCallStack must be boolean type)`),o.appenders.forEach((r=>{n.throwExceptionIf(e,n.not(u.get(r)),`category "${t}" is not valid (appender "${r}" is not defined)`)})),n.throwExceptionIf(e,n.not(r.getLevel(o.level)),`category "${t}" is not valid (level "${o.level}" not recognised; valid levels are ${r.levels.join(", ")})`)})),n.throwExceptionIf(e,n.not(e.categories.default),'must define a "default" category.')}));const c=e=>{o.clear();Object.keys(e.categories).forEach((n=>{const i=e.categories[n],s=[];i.appenders.forEach((e=>{s.push(u.get(e)),t(`Creating category ${n}`),o.set(n,{appenders:s,level:r.getLevel(i.level),enableCallStack:i.enableCallStack||!1})}))}))},a=()=>{c({categories:{default:{appenders:["out"],level:"OFF"}}})};a(),n.addListener(c);const l=e=>(t(`configForCategory: searching for config for ${e}`),o.has(e)?(t(`configForCategory: ${e} exists in config, returning it`),o.get(e)):e.indexOf(".")>0?(t(`configForCategory: ${e} has hierarchy, searching for parents`),l(e.substring(0,e.lastIndexOf(".")))):(t("configForCategory: returning config for default category"),l("default")));e.exports=o,e.exports=Object.assign(e.exports,{appendersForCategory:e=>l(e).appenders,getLevelForCategory:e=>l(e).level,setLevelForCategory:(e,n)=>{let r=o.get(e);if(t(`setLevelForCategory: found ${r} for ${e}`),!r){const n=l(e);t(`setLevelForCategory: no config found for category, found ${n} for parents of ${e}`),r={appenders:n.appenders}}r.level=n,o.set(e,r)},getEnableCallStackForCategory:e=>!0===l(e).enableCallStack,setEnableCallStackForCategory:(e,t)=>{l(e).enableCallStack=t},init:a})}(wa);const Oa=Nr.exports("log4js:logger"),ba=Hu,_a=gu,Ba=eo,Pa=wa.exports,ka=tu,xa=/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;function Na(e,t=4){const n=e.stack.split("\n").slice(t),r=xa.exec(n[0]);return r&&6===r.length?{functionName:r[1],fileName:r[2],lineNumber:parseInt(r[3],10),columnNumber:parseInt(r[4],10),callStack:n.join("\n")}:null}class Ia{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.parseCallStack=Na,Oa(`Logger created (${this.category}, ${this.level})`)}get level(){return _a.getLevel(Pa.getLevelForCategory(this.category),_a.TRACE)}set level(e){Pa.setLevelForCategory(this.category,_a.getLevel(e,this.level))}get useCallStack(){return Pa.getEnableCallStackForCategory(this.category)}set useCallStack(e){Pa.setEnableCallStackForCategory(this.category,!0===e)}log(e,...t){let n=_a.getLevel(e);n||(this._log(_a.WARN,"log4js:logger.log: invalid value for log-level as first parameter given: ",e),n=_a.INFO),this.isLevelEnabled(n)&&this._log(n,t)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,t){Oa(`sending log data (${e}) to appenders`);const n=new ba(this.category,e,t,this.context,this.useCallStack&&this.parseCallStack(new Error));Ba.send(n)}addContext(e,t){this.context[e]=t}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){this.parseCallStack=e}}function Ta(e){const t=_a.getLevel(e),n=t.toString().toLowerCase().replace(/_([a-z])/g,(e=>e[1].toUpperCase())),r=n[0].toUpperCase()+n.slice(1);Ia.prototype[`is${r}Enabled`]=function(){return this.isLevelEnabled(t)},Ia.prototype[n]=function(...e){this.log(t,...e)}}_a.levels.forEach(Ta),ka.addListener((()=>{_a.levels.forEach(Ta)}));var Ra=Ia;const Ma=gu;function La(e){return e.originalUrl||e.url}function ja(e,t){for(let n=0;ne.source?e.source:e));t=new RegExp(n.join("|"))}return t}(t.nolog);return(e,i,s)=>{if(e._logging)return s();if(o&&o.test(e.originalUrl))return s();if(n.isLevelEnabled(r)||"auto"===t.level){const o=new Date,{writeHead:s}=i;e._logging=!0,i.writeHead=(e,t)=>{i.writeHead=s,i.writeHead(e,t),i.__statusCode=e,i.__headers=t||{}},i.on("finish",(()=>{i.responseTime=new Date-o,i.statusCode&&"auto"===t.level&&(r=Ma.INFO,i.statusCode>=300&&(r=Ma.WARN),i.statusCode>=400&&(r=Ma.ERROR)),r=function(e,t,n){let r=t;if(n){const t=n.find((t=>{let n=!1;return n=t.from&&t.to?e>=t.from&&e<=t.to:-1!==t.codes.indexOf(e),n}));t&&(r=Ma.getLevel(t.level,r))}return r}(i.statusCode,r,t.statusRules);const s=function(e,t,n){const r=[];return r.push({token:":url",replacement:La(e)}),r.push({token:":protocol",replacement:e.protocol}),r.push({token:":hostname",replacement:e.hostname}),r.push({token:":method",replacement:e.method}),r.push({token:":status",replacement:t.__statusCode||t.statusCode}),r.push({token:":response-time",replacement:t.responseTime}),r.push({token:":date",replacement:(new Date).toUTCString()}),r.push({token:":referrer",replacement:e.headers.referer||e.headers.referrer||""}),r.push({token:":http-version",replacement:`${e.httpVersionMajor}.${e.httpVersionMinor}`}),r.push({token:":remote-addr",replacement:e.headers["x-forwarded-for"]||e.ip||e._remoteAddress||e.socket&&(e.socket.remoteAddress||e.socket.socket&&e.socket.socket.remoteAddress)}),r.push({token:":user-agent",replacement:e.headers["user-agent"]}),r.push({token:":content-length",replacement:t.getHeader("content-length")||t.__headers&&t.__headers["Content-Length"]||"-"}),r.push({token:/:req\[([^\]]+)]/g,replacement:(t,n)=>e.headers[n.toLowerCase()]}),r.push({token:/:res\[([^\]]+)]/g,replacement:(e,n)=>t.getHeader(n.toLowerCase())||t.__headers&&t.__headers[n]}),(e=>{const t=e.concat();for(let e=0;eja(e,s)));t&&n.log(r,t)}else n.log(r,ja(u,s));t.context&&n.removeContext("res")}))}return s()}},nl=Va;let rl=!1;function ul(e){if(!rl)return;Ua("Received log event ",e);Za.appendersForCategory(e.categoryName).forEach((t=>{t(e)}))}function ol(e){rl&&il();let t=e;return"string"==typeof t&&(t=function(e){Ua(`Loading configuration from ${e}`);try{return JSON.parse(Wa.readFileSync(e,"utf8"))}catch(t){throw new Error(`Problem reading config from file "${e}". Error was ${t.message}`,t)}}(e)),Ua(`Configuration is ${t}`),Ka.configure(za(t)),el.onMessage(ul),rl=!0,sl}function il(e){Ua("Shutdown called. Disabling all log writing."),rl=!1;const t=Array.from(Xa.values());Xa.init(),Za.init();const n=t.reduceRight(((e,t)=>t.shutdown?e+1:e),0);if(0===n)return Ua("No appenders with shutdown functions found."),void 0!==e&&e();let r,u=0;function o(t){r=r||t,u+=1,Ua(`Appender shutdowns complete: ${u} / ${n}`),u>=n&&(Ua("All shutdown functions completed."),e&&e(r))}return Ua(`Found ${n} appenders with shutdown functions.`),t.filter((e=>e.shutdown)).forEach((e=>e.shutdown(o))),null}const sl={getLogger:function(e){return rl||ol(process.env.LOG4JS_CONFIG||{appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"OFF"}}}),new Qa(e||"default")},configure:ol,shutdown:il,connectLogger:tl,levels:Ya,addLayout:qa.addLayout,recording:function(){return nl}};var cl=sl,al={};Object.defineProperty(al,"__esModule",{value:!0}),al.levelMap=al.getLevel=al.setCategoriesLevel=al.getConfiguration=al.setConfiguration=void 0;const ll=cl;let fl={appenders:{debug:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %p %c %[%m%]"}},info:{type:"stdout",layout:{type:"pattern",pattern:"[%d] > hvigor %[%m%]"}},"no-pattern-info":{type:"stdout",layout:{type:"pattern",pattern:"%m"}},wrong:{type:"stderr",layout:{type:"pattern",pattern:"[%d] > hvigor %[%p: %m%]"}},"just-debug":{type:"logLevelFilter",appender:"debug",level:"debug",maxLevel:"debug"},"just-info":{type:"logLevelFilter",appender:"info",level:"info",maxLevel:"info"},"just-wrong":{type:"logLevelFilter",appender:"wrong",level:"warn",maxLevel:"error"}},categories:{default:{appenders:["just-debug","just-info","just-wrong"],level:"debug"},"no-pattern-info":{appenders:["no-pattern-info"],level:"info"}}};al.setConfiguration=e=>{fl=e};al.getConfiguration=()=>fl;let dl=ll.levels.DEBUG;al.setCategoriesLevel=(e,t)=>{dl=e;const n=fl.categories;for(const r in n)(null==t?void 0:t.includes(r))||Object.prototype.hasOwnProperty.call(n,r)&&(n[r].level=e.levelStr)};al.getLevel=()=>dl,al.levelMap=new Map([["ALL",ll.levels.ALL],["MARK",ll.levels.MARK],["TRACE",ll.levels.TRACE],["DEBUG",ll.levels.DEBUG],["INFO",ll.levels.INFO],["WARN",ll.levels.WARN],["ERROR",ll.levels.ERROR],["FATAL",ll.levels.FATAL],["OFF",ll.levels.OFF]]);var Dl=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),pl=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),El=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Dl(t,e,n);return pl(t,e),t};Object.defineProperty(xr,"__esModule",{value:!0}),xr.evaluateLogLevel=xr.HvigorLogger=void 0;const ml=El(cl),hl=cl,yl=El(F.default),Cl=al;class Fl{constructor(e){ml.configure((0,Cl.getConfiguration)()),this._logger=ml.getLogger(e),this._logger.level=(0,Cl.getLevel)()}static getLogger(e){return new Fl(e)}log(e,...t){this._logger.log(e,...t)}debug(e,...t){this._logger.debug(e,...t)}info(e,...t){this._logger.info(e,...t)}warn(e,...t){void 0!==e&&""!==e&&this._logger.warn(e,...t)}error(e,...t){this._logger.error(e,...t)}_printTaskExecuteInfo(e,t){this.info(`Finished :${e}... after ${t}`)}_printFailedTaskInfo(e){this.error(`Failed :${e}... `)}_printDisabledTaskInfo(e){this.info(`Disabled :${e}... `)}_printUpToDateTaskInfo(e){this.info(`UP-TO-DATE :${e}... `)}errorMessageExit(e,...t){throw new Error(yl.format(e,...t))}errorExit(e,t,...n){t&&this._logger.error(t,n),this._logger.error(e.stack)}setLevel(e,t){(0,Cl.setCategoriesLevel)(e,t),ml.shutdown(),ml.configure((0,Cl.getConfiguration)())}getLevel(){return this._logger.level}configure(e){const t=(0,Cl.getConfiguration)(),n={appenders:{...t.appenders,...e.appenders},categories:{...t.categories,...e.categories}};(0,Cl.setConfiguration)(n),ml.shutdown(),ml.configure(n)}}xr.HvigorLogger=Fl,xr.evaluateLogLevel=function(e,t){t.debug?e.setLevel(hl.levels.DEBUG):t.warn?e.setLevel(hl.levels.WARN):t.error?e.setLevel(hl.levels.ERROR):e.setLevel(hl.levels.INFO)};var gl=w&&w.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0}),X.parseJsonText=X.parseJsonFile=void 0;const Al=Z,vl=gl(kr),Sl=gl(p.default),wl=gl(E.default),Ol=xr.HvigorLogger.getLogger("parse-json-util");var bl;!function(e){e[e.Char=0]="Char",e[e.EOF=1]="EOF",e[e.Identifier=2]="Identifier"}(bl||(bl={}));let _l,Bl,Pl,kl,xl,Nl,Il="start",Tl=[],Rl=0,Ml=1,Ll=0,jl=!1,$l="default",Hl="'",Jl=1;function Gl(e,t=!1){Bl=String(e),Il="start",Tl=[],Rl=0,Ml=1,Ll=0,kl=void 0,jl=t;do{_l=Vl(),Xl[Il]()}while("eof"!==_l.type);return kl}function Vl(){for($l="default",xl="",Hl="'",Jl=1;;){Nl=Ul();const e=zl[$l]();if(e)return e}}function Ul(){if(Bl[Rl])return String.fromCodePoint(Bl.codePointAt(Rl))}function Wl(){const e=Ul();return"\n"===e?(Ml++,Ll=0):e?Ll+=e.length:Ll++,e&&(Rl+=e.length),e}X.parseJsonFile=function(e,t=!1,n="utf-8"){const r=vl.default.readFileSync(Sl.default.resolve(e),{encoding:n});try{return Gl(r,t)}catch(t){if(t instanceof SyntaxError){const n=t.message.split("at");2===n.length&&Ol.errorMessageExit(`${n[0].trim()}${wl.default.EOL}\t at ${e}:${n[1].trim()}`)}Ol.errorMessageExit(`${e} is not in valid JSON/JSON5 format.`)}},X.parseJsonText=Gl;const zl={default(){switch(Nl){case"/":return Wl(),void($l="comment");case void 0:return Wl(),Kl("eof")}if(!Al.JudgeUtil.isIgnoreChar(Nl)&&!Al.JudgeUtil.isSpaceSeparator(Nl))return zl[Il]();Wl()},start(){$l="value"},beforePropertyName(){switch(Nl){case"$":case"_":return xl=Wl(),void($l="identifierName");case"\\":return Wl(),void($l="identifierNameStartEscape");case"}":return Kl("punctuator",Wl());case'"':case"'":return Hl=Nl,Wl(),void($l="string")}if(Al.JudgeUtil.isIdStartChar(Nl))return xl+=Wl(),void($l="identifierName");throw tf(bl.Char,Wl())},afterPropertyName(){if(":"===Nl)return Kl("punctuator",Wl());throw tf(bl.Char,Wl())},beforePropertyValue(){$l="value"},afterPropertyValue(){switch(Nl){case",":case"}":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},beforeArrayValue(){if("]"===Nl)return Kl("punctuator",Wl());$l="value"},afterArrayValue(){switch(Nl){case",":case"]":return Kl("punctuator",Wl())}throw tf(bl.Char,Wl())},end(){throw tf(bl.Char,Wl())},comment(){switch(Nl){case"*":return Wl(),void($l="multiLineComment");case"/":return Wl(),void($l="singleLineComment")}throw tf(bl.Char,Wl())},multiLineComment(){switch(Nl){case"*":return Wl(),void($l="multiLineCommentAsterisk");case void 0:throw tf(bl.Char,Wl())}Wl()},multiLineCommentAsterisk(){switch(Nl){case"*":return void Wl();case"/":return Wl(),void($l="default");case void 0:throw tf(bl.Char,Wl())}Wl(),$l="multiLineComment"},singleLineComment(){switch(Nl){case"\n":case"\r":case"\u2028":case"\u2029":return Wl(),void($l="default");case void 0:return Wl(),Kl("eof")}Wl()},value(){switch(Nl){case"{":case"[":return Kl("punctuator",Wl());case"n":return Wl(),ql("ull"),Kl("null",null);case"t":return Wl(),ql("rue"),Kl("boolean",!0);case"f":return Wl(),ql("alse"),Kl("boolean",!1);case"-":case"+":return"-"===Wl()&&(Jl=-1),void($l="numerical");case".":case"0":case"I":case"N":return void($l="numerical");case'"':case"'":return Hl=Nl,Wl(),xl="",void($l="string")}if(void 0===Nl||!Al.JudgeUtil.isDigitWithoutZero(Nl))throw tf(bl.Char,Wl());$l="numerical"},numerical(){switch(Nl){case".":return xl=Wl(),void($l="decimalPointLeading");case"0":return xl=Wl(),void($l="zero");case"I":return Wl(),ql("nfinity"),Kl("numeric",Jl*(1/0));case"N":return Wl(),ql("aN"),Kl("numeric",NaN)}if(void 0!==Nl&&Al.JudgeUtil.isDigitWithoutZero(Nl))return xl=Wl(),void($l="decimalInteger");throw tf(bl.Char,Wl())},zero(){switch(Nl){case".":case"e":case"E":return void($l="decimal");case"x":case"X":return xl+=Wl(),void($l="hexadecimal")}return Kl("numeric",0)},decimalInteger(){switch(Nl){case".":case"e":case"E":return void($l="decimal")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimal(){switch(Nl){case".":xl+=Wl(),$l="decimalFraction";break;case"e":case"E":xl+=Wl(),$l="decimalExponent"}},decimalPointLeading(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalFraction");throw tf(bl.Char,Wl())},decimalFraction(){switch(Nl){case"e":case"E":return xl+=Wl(),void($l="decimalExponent")}if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},decimalExponent(){switch(Nl){case"+":case"-":return xl+=Wl(),void($l="decimalExponentSign")}if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentSign(){if(Al.JudgeUtil.isDigit(Nl))return xl+=Wl(),void($l="decimalExponentInteger");throw tf(bl.Char,Wl())},decimalExponentInteger(){if(!Al.JudgeUtil.isDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},hexadecimal(){if(Al.JudgeUtil.isHexDigit(Nl))return xl+=Wl(),void($l="hexadecimalInteger");throw tf(bl.Char,Wl())},hexadecimalInteger(){if(!Al.JudgeUtil.isHexDigit(Nl))return Kl("numeric",Jl*Number(xl));xl+=Wl()},identifierNameStartEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":break;default:if(!Al.JudgeUtil.isIdStartChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},identifierName(){switch(Nl){case"$":case"_":case"‌":case"‍":return void(xl+=Wl());case"\\":return Wl(),void($l="identifierNameEscape")}if(!Al.JudgeUtil.isIdContinueChar(Nl))return Kl("identifier",xl);xl+=Wl()},identifierNameEscape(){if("u"!==Nl)throw tf(bl.Char,Wl());Wl();const e=Yl();switch(e){case"$":case"_":case"‌":case"‍":break;default:if(!Al.JudgeUtil.isIdContinueChar(e))throw tf(bl.Identifier)}xl+=e,$l="identifierName"},string(){switch(Nl){case"\\":return Wl(),void(xl+=function(){const e=Ul(),t=function(){switch(Ul()){case"b":return Wl(),"\b";case"f":return Wl(),"\f";case"n":return Wl(),"\n";case"r":return Wl(),"\r";case"t":return Wl(),"\t";case"v":return Wl(),"\v"}return}();if(t)return t;switch(e){case"0":if(Wl(),Al.JudgeUtil.isDigit(Ul()))throw tf(bl.Char,Wl());return"\0";case"x":return Wl(),function(){let e="",t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());if(e+=Wl(),t=Ul(),!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());return e+=Wl(),String.fromCodePoint(parseInt(e,16))}();case"u":return Wl(),Yl();case"\n":case"\u2028":case"\u2029":return Wl(),"";case"\r":return Wl(),"\n"===Ul()&&Wl(),""}if(void 0===e||Al.JudgeUtil.isDigitWithoutZero(e))throw tf(bl.Char,Wl());return Wl()}());case'"':case"'":if(Nl===Hl){const e=Kl("string",xl);return Wl(),e}return void(xl+=Wl());case"\n":case"\r":case void 0:throw tf(bl.Char,Wl());case"\u2028":case"\u2029":!function(e){Ol.warn(`JSON5: '${ef(e)}' in strings is not valid ECMAScript; consider escaping.`)}(Nl)}xl+=Wl()}};function Kl(e,t){return{type:e,value:t,line:Ml,column:Ll}}function ql(e){for(const t of e){if(Ul()!==t)throw tf(bl.Char,Wl());Wl()}}function Yl(){let e="",t=4;for(;t-- >0;){const t=Ul();if(!Al.JudgeUtil.isHexDigit(t))throw tf(bl.Char,Wl());e+=Wl()}return String.fromCodePoint(parseInt(e,16))}const Xl={start(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},beforePropertyName(){switch(_l.type){case"identifier":case"string":return Pl=_l.value,void(Il="afterPropertyName");case"punctuator":return void Ql();case"eof":throw tf(bl.EOF)}},afterPropertyName(){if("eof"===_l.type)throw tf(bl.EOF);Il="beforePropertyValue"},beforePropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);Zl()},afterPropertyValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforePropertyName");case"}":Ql()}},beforeArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);"punctuator"!==_l.type||"]"!==_l.value?Zl():Ql()},afterArrayValue(){if("eof"===_l.type)throw tf(bl.EOF);switch(_l.value){case",":return void(Il="beforeArrayValue");case"]":Ql()}},end(){}};function Zl(){const e=function(){let e;switch(_l.type){case"punctuator":switch(_l.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=_l.value}return e}();if(jl&&"object"==typeof e&&(e._line=Ml,e._column=Ll),void 0===kl)kl=e;else{const t=Tl[Tl.length-1];Array.isArray(t)?jl&&"object"!=typeof e?t.push({value:e,_line:Ml,_column:Ll}):t.push(e):t[Pl]=jl&&"object"!=typeof e?{value:e,_line:Ml,_column:Ll}:e}!function(e){if(e&&"object"==typeof e)Tl.push(e),Il=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}}(e)}function Ql(){Tl.pop();const e=Tl[Tl.length-1];Il=e?Array.isArray(e)?"afterArrayValue":"afterPropertyValue":"end"}function ef(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const t=e.charCodeAt(0).toString(16);return`\\x${`00${t}`.substring(t.length)}`}return e}function tf(e,t){let n="";switch(e){case bl.Char:n=void 0===t?`JSON5: invalid end of input at ${Ml}:${Ll}`:`JSON5: invalid character '${ef(t)}' at ${Ml}:${Ll}`;break;case bl.EOF:n=`JSON5: invalid end of input at ${Ml}:${Ll}`;break;case bl.Identifier:Ll-=5,n=`JSON5: invalid identifier character at ${Ml}:${Ll}`}const r=new nf(n);return r.lineNumber=Ml,r.columnNumber=Ll,r}class nf extends SyntaxError{}var rf=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),uf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),of=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&rf(t,e,n);return uf(t,e),t};Object.defineProperty(Y,"__esModule",{value:!0});var sf=Y.cleanWorkSpace=Ff=Y.executeInstallHvigor=yf=Y.isHvigorInstalled=mf=Y.isAllDependenciesInstalled=void 0;const cf=of(D.default),af=of(p.default),lf=b,ff=j,df=$,Df=X;let pf,Ef;var mf=Y.isAllDependenciesInstalled=function(){function e(e){const t=null==e?void 0:e.dependencies;return void 0===t?0:Object.getOwnPropertyNames(t).length}if(pf=gf(),Ef=Af(),e(pf)+1!==e(Ef))return!1;for(const e in null==pf?void 0:pf.dependencies)if(!(0,ff.hasNpmPackInPaths)(e,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])||!hf(e,pf,Ef))return!1;return!0};function hf(e,t,n){return void 0!==n.dependencies&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,t.dependencies[e])===n.dependencies[e]}var yf=Y.isHvigorInstalled=function(){return pf=gf(),Ef=Af(),(0,ff.hasNpmPackInPaths)(lf.HVIGOR_ENGINE_PACKAGE_NAME,[lf.HVIGOR_PROJECT_DEPENDENCIES_HOME])&&(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion)===Ef.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]};const Cf={cwd:lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,stdio:["inherit","inherit","inherit"]};var Ff=Y.executeInstallHvigor=function(){(0,df.logInfoPrintConsole)("Hvigor installing...");const e={dependencies:{}};e.dependencies[lf.HVIGOR_ENGINE_PACKAGE_NAME]=(0,ff.offlinePluginConversion)(lf.HVIGOR_PROJECT_ROOT_DIR,pf.hvigorVersion);try{cf.mkdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,{recursive:!0});const t=af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,lf.DEFAULT_PACKAGE_JSON);cf.writeFileSync(t,JSON.stringify(e))}catch(e){(0,df.logErrorAndExit)(e)}!function(){const e=["config","set","store-dir",lf.HVIGOR_PNPM_STORE_PATH];(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,e,Cf)}(),(0,ff.executeCommand)(lf.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,["install"],Cf)};function gf(){const e=af.resolve(lf.HVIGOR_PROJECT_WRAPPER_HOME,lf.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);return cf.existsSync(e)||(0,df.logErrorAndExit)(`Error: Hvigor config file ${e} does not exist.`),(0,Df.parseJsonFile)(e)}function Af(){return cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH)?(0,Df.parseJsonFile)(lf.HVIGOR_PROJECT_DEPENDENCY_PACKAGE_JSON_PATH):{dependencies:{}}}sf=Y.cleanWorkSpace=function(){if((0,df.logInfoPrintConsole)("Hvigor cleaning..."),!cf.existsSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME))return;const e=cf.readdirSync(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME);if(e&&0!==e.length){cf.existsSync(lf.HVIGOR_BOOT_JS_FILE_PATH)&&(0,ff.executeCommand)(process.argv[0],[lf.HVIGOR_BOOT_JS_FILE_PATH,"--stop-daemon"],{});try{e.forEach((e=>{cf.rmSync(af.resolve(lf.HVIGOR_PROJECT_DEPENDENCIES_HOME,e),{recursive:!0})}))}catch(e){(0,df.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${lf.HVIGOR_PROJECT_DEPENDENCIES_HOME}.`)}}};var vf={},Sf=w&&w.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),wf=w&&w.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Of=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Sf(t,e,n);return wf(t,e),t};Object.defineProperty(vf,"__esModule",{value:!0});var bf=vf.executeBuild=void 0;const _f=b,Bf=Of(D.default),Pf=Of(p.default),kf=$;bf=vf.executeBuild=function(){const e=Pf.resolve(_f.HVIGOR_PROJECT_DEPENDENCIES_HOME,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const t=Bf.realpathSync(e);require(t)}catch(t){(0,kf.logErrorAndExit)(`Error: ENOENT: no such file ${e},delete ${_f.HVIGOR_PROJECT_DEPENDENCIES_HOME} and retry.`)}},function(){if(O.checkNpmConifg(),O.environmentHandler(),O.isPnpmAvailable()||O.executeInstallPnpm(),yf()&&mf())bf();else{sf();try{Ff()}catch(e){return void sf()}bf()}}(); \ No newline at end of file diff --git a/code/BasicFeature/Media/AVRecorder/hvigorw b/code/BasicFeature/Media/AVRecorder/hvigorw deleted file mode 100644 index d0a563c20ab052c32d602855d07029549d314cf4..0000000000000000000000000000000000000000 --- a/code/BasicFeature/Media/AVRecorder/hvigorw +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -# ---------------------------------------------------------------------------- -# Copyright (c) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Hvigor startup script, version 1.0.0 -# -# Required ENV vars: -# ------------------ -# NODE_HOME - location of a Node home dir -# or -# Add /usr/local/nodejs/bin to the PATH environment variable -# ---------------------------------------------------------------------------- - -HVIGOR_APP_HOME=$(dirname $(readlink -f $0)) -HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js -warn() { - echo "" - echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -error() { - echo "" - echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" -} - -fail() { - error "$@" - exit 1 -} - -# Determine node to start hvigor wrapper script -if [ -n "${NODE_HOME}" ];then - EXECUTABLE_NODE="${NODE_HOME}/bin/node" - if [ ! -x "$EXECUTABLE_NODE" ];then - fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed" - fi -else - EXECUTABLE_NODE="node" - which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path" -fi - -# Check hvigor wrapper script -if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then - fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}" -fi - -# start hvigor-wrapper script -exec "${EXECUTABLE_NODE}" \ - "${HVIGOR_WRAPPER_SCRIPT}" "$@" diff --git a/code/BasicFeature/Media/AVRecorder/hvigorw.bat b/code/BasicFeature/Media/AVRecorder/hvigorw.bat deleted file mode 100644 index af893e9a2c9170d04610c906f1cf1b6f3ac144ac..0000000000000000000000000000000000000000 --- a/code/BasicFeature/Media/AVRecorder/hvigorw.bat +++ /dev/null @@ -1,72 +0,0 @@ -:: Copyright (c) 2023 Huawei Device Co., Ltd. -:: Licensed under the Apache License, Version 2.0 (the "License"); -:: you may not use this file except in compliance with the License. -:: You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, software -:: distributed under the License is distributed on an "AS IS" BASIS, -:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -:: See the License for the specific language governing permissions and -:: limitations under the License. - -@echo off - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Hvigor startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js -set NODE_EXE=node.exe - -goto start - -:start -@rem Find node.exe -if defined NODE_HOME goto findNodeFromNodeHome - -%NODE_EXE% --version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:findNodeFromNodeHome -set NODE_HOME=%NODE_HOME:"=% -set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE% - -if exist "%NODE_EXE_PATH%" goto execute -echo. -echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. -echo. -echo Please set the NODE_HOME variable in your environment to match the -echo location of your NodeJs installation. - -goto fail - -:execute -@rem Execute hvigor -"%NODE_EXE%" %WRAPPER_MODULE_PATH% %* - -:fail -exit /b 1 diff --git a/code/BasicFeature/Media/AVRecorder/oh-package.json5 b/code/BasicFeature/Media/AVRecorder/oh-package.json5 index 5acce477eaadfa04031049ea750c7e0e3e97b792..927868f6d10f9d7c7b84b676e4888b76837a39e6 100644 --- a/code/BasicFeature/Media/AVRecorder/oh-package.json5 +++ b/code/BasicFeature/Media/AVRecorder/oh-package.json5 @@ -1,5 +1,5 @@ /* -* Copyright (C) 2023 Huawei Device Co., Ltd. +* Copyright (C) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,6 +14,7 @@ */ { + "modelVersion": "5.0.0", "license": "ISC", "devDependencies": { "@ohos/hypium": "1.0.6" @@ -23,4 +24,4 @@ "repository": {}, "version": "1.0.0", "dependencies": {} -} +} \ No newline at end of file diff --git a/code/BasicFeature/Media/AVSession/VideoPlayer/README.md b/code/BasicFeature/Media/AVSession/VideoPlayer/README.md index d8607342634340cefb2d823885ed34e7540563a6..b6b3b3463538e83a539f0984ef7b98268a247072 100644 --- a/code/BasicFeature/Media/AVSession/VideoPlayer/README.md +++ b/code/BasicFeature/Media/AVSession/VideoPlayer/README.md @@ -2,7 +2,7 @@ ### 介绍 -本示例主要展示了网络视频播放的相关功能。使用[@ohos.multimedia.avsession](https://docs.openharmony.cn/pages/v4.0/zh-cn/application-dev/reference/apis/js-apis-avsession.md)等接口实现视频播放的功能。 +本示例主要展示了网络视频播放的相关功能。使用[@ohos.multimedia.avsession](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-avsession-kit/js-apis-avsession.md)等接口实现视频播放的功能。 ### 效果预览 diff --git a/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/ets/common/AudioUtils.ets b/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/ets/common/AudioUtils.ets index 548eafd9e0e153122c08c74643054e938a33d43b..937f6c013a4ad09316205eec839364d6a775b80c 100644 --- a/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/ets/common/AudioUtils.ets +++ b/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/ets/common/AudioUtils.ets @@ -23,6 +23,7 @@ export default class AudioUtils { public surfaceId: string = ''; private callbackMap: Map = new Map(); private playState: SubscribedAbstractProperty; + private videoLoadedCallback: (isLoaded: boolean) => void = () => {}; constructor() { Log.info(`AVPlayer seek succeede in `); @@ -35,6 +36,10 @@ export default class AudioUtils { return this.avPlayer; } + setVideoLoadedCallback(callback: (isLoaded: boolean) => void) { + this.videoLoadedCallback = callback; + } + setAVPlayerCallback() { if (!this.avPlayer) { Log.info('no acPlayer'); @@ -61,6 +66,7 @@ export default class AudioUtils { } try { this.avPlayer?.prepare().then(() => { + this.videoLoadedCallback(true); Log.info('AVPlayer prepare succeeded.'); }); } catch(err) { @@ -103,6 +109,7 @@ export default class AudioUtils { } public async loadFromSrcFd(fileDescriptor: media.AVFileDescriptor) { + this.videoLoadedCallback(false); Log.info('loadFromSrcFd: ' + JSON.stringify(fileDescriptor)); if (!this.avPlayer) { Log.info('no acPlayer'); @@ -116,6 +123,7 @@ export default class AudioUtils { } public async loadFromRawFile(fileName: string) { + this.videoLoadedCallback(false); Log.info('loadFromRawFile: ' + fileName); if (!this.avPlayer) { Log.info('no avplayer'); @@ -132,6 +140,7 @@ export default class AudioUtils { } public async loadFromNetwork(url: string) { + this.videoLoadedCallback(false); Log.info('loadFromNetwork: ' + url); if (!this.avPlayer) { Log.info('no avplayer'); diff --git a/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/ets/common/Constants.ets b/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/ets/common/Constants.ets index e43255c4e3d6b94cca5f9ccd9db5ae33c509e494..a21cbfe0e1a2d0706afe00068cf87f949cb3d20d 100644 --- a/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/ets/common/Constants.ets +++ b/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/ets/common/Constants.ets @@ -23,7 +23,7 @@ export default class Constants { assetId: 'VIDEO-1-h264_1500k_mp4', title: 'h264_1500k_mp4', artist: 'Rain', - mediaUri: 'https://mazwai.com/videvo_files/video/free/2015-05/small_watermarked/benjamin_wu--raccoon_come_and_go_preview.webm', + mediaUri: 'http://vjs.zencdn.net/v/oceans.mp4', mediaType: 'VIDEO', mediaSize: 1000, startPosition: 0, @@ -36,7 +36,7 @@ export default class Constants { assetId: 'VIDEO-2-oceans', title: 'oceans.mp4', artist: 'Rain', - mediaUri: 'https://mazwai.com/videvo_files/video/free/2014-08/small_watermarked/clint_melander--a_day_without_rain_preview.webm', + mediaUri: 'https://www.w3schools.com/html/movie.mp4', mediaType: 'VIDEO', mediaSize: 1000, startPosition: 0, diff --git a/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/ets/pages/Index.ets b/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/ets/pages/Index.ets index 45965c7e1a835a263f4e26e14dfbe7f6dcd15fce..5d77d9eda1e0faec50a52153d3e415538182f6bb 100644 --- a/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/ets/pages/Index.ets +++ b/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/ets/pages/Index.ets @@ -56,6 +56,7 @@ struct Index { @State isProgressSliding: boolean = false; @State audioType: 'url' | 'rawfile' | 'scan' | 'video' = 'url'; @State avCastPickerColor:Color = Color.White; + @State isLoaded: boolean = false; private audioUtils: AudioUtils = new AudioUtils(); private avPlayer: media.AVPlayer | undefined = undefined; private audioVolumeGroupManager: audio.AudioVolumeGroupManager | undefined = undefined; @@ -72,6 +73,9 @@ struct Index { this.songList = this.urlVideoList; this.audioType = 'video'; this.currentPlayInfo = this.urlVideoList[0]; + this.audioUtils.setVideoLoadedCallback((isLoaded: boolean) => { + this.isLoaded = isLoaded; + }); this.avPlayer = await this.audioUtils.init(); this.avPlayer?.on('audioInterrupt', (info: audio.InterruptEvent) => { Log.info('audioInterrupt success, and InterruptEvent info is: ' + info); @@ -790,16 +794,21 @@ struct Index { // video if (this.playType === 'local') { Row() { - Stack({ alignContent: Alignment.Bottom }) { + Stack({ alignContent: Alignment.Center }) { XComponent({ id: '', type: 'surface', controller: this.mXComponentController }) .onLoad(() => { const surfaceId = this.mXComponentController.getXComponentSurfaceId(); Log.info('XComponent onLoad, surfaceId = ' + surfaceId); this.audioUtils.surfaceId = surfaceId; }) + LoadingProgress() + .color(Color.White) + .width(100) + .height(100) + .visibility(this.isLoaded ? Visibility.None : Visibility.Visible) } .width('100%') - .height(200) + .height(400) } .flexShrink(0) .width('100%') diff --git a/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/module.json5 b/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/module.json5 index 013ce429336e044fe5b16de49415ee5b261fcfab..f506847647b0374db8a3c169dd0aacc8ecffdf5e 100644 --- a/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/module.json5 +++ b/code/BasicFeature/Media/AVSession/VideoPlayer/entry/src/main/module.json5 @@ -47,6 +47,11 @@ } ] } + ], + "requestPermissions": [ + { + "name": "ohos.permission.INTERNET" + } ] } } \ No newline at end of file diff --git a/code/BasicFeature/Media/Camera/README.md b/code/BasicFeature/Media/Camera/README.md index 03c293b3d567f6544026bc93bb1bf48bea58741b..daecf309e7034d14672fa801e892c6f7cc2fe887 100644 --- a/code/BasicFeature/Media/Camera/README.md +++ b/code/BasicFeature/Media/Camera/README.md @@ -1,4 +1,5 @@ -# CameraSample + +# 相机 ### 介绍 @@ -73,7 +74,7 @@ entry/src/main ``` ### 具体实现 -* 相机功能接口实现在CameraManager.cpp中,源码参考:[CameraManager.cpp](entry/src/main/cpp/CameraManager.cpp) +* 相机功能接口实现在CameraManager.cpp中,源码参考:[CameraManager.cpp](entry/src/main/cpp/camera_manager.cpp) * 在NDKCamera构造函数里完成一个相机生命周期初始化的过程,包括调用OH_Camera_GetCameraMananger获取CameraMananger,调用OH_CameraManager_CreateCaptureSession创建CaptureSession,调用CaptureSessionRegisterCallback创建CaptureSession注册回调,调用GetSupportedCameras获取支持的camera设备,调用GetSupportedOutputCapability获取支持的camera设备能力集,调用CreatePreviewOutput创建预览输出,调用CreateCameraInput创建相机输入,调用CameraInputOpen打开相机输入,调用CameraManagerRegisterCallback创建CameraManager注册回调,最后调用SessionFlowFn开启Session。 * 其中SessionFlowFn是一个开启预览的动作,主要流程包括:调用OH_CaptureSession_BeginConfig开始配置会话,调用OH_CaptureSession_AddInput把CameraInput加入到会话,调用OH_CaptureSession_AddPreviewOutput把previewOutput加入到会话,调用OH_CaptureSession_CommitConfig提交配置信息,调用OH_CaptureSession_Start开始会话工作,还有一步是在开启预览的同时调用IsFocusMode启动对焦功能,这边后面会涉及到。 * 在NDKCamera析构函数里完成对相机生命周期释放的过程,调用OH_CameraManager_DeleteSupportedCameras删除支持的camera设备,调用OH_CameraManager_DeleteSupportedCameraOutputCapability删除支持的camera设备能力集,调用OH_Camera_DeleteCameraMananger删除camera manager。 @@ -95,17 +96,17 @@ entry/src/main * CaptureSessionRegisterCallback:session出现异常时以及开启对焦模式时触发回调 -* 相机预览、拍照、录像功能、前后置切换功能实现调用侧位于tableIndex.ets,modeSwitchPage.ets,main.cpp中,源码参考:[tableIndex.ets](entry/src/main/cpp/ets/pages/tableIndex.ets),[modeSwitchPage.ets](entry/src/main/cpp/ets/views/modeSwitchPage.ets),[main.cpp](entry/src/main/cpp/main.cpp) - * 预览:开启预览位于tableIndex.ets下的onPageShow接口,其中调用cameraDemo.initCamera接口,将预览的surfaceId,对焦模式的值,以及是前置还是后置摄像头设备作为入参啊传下去,实际调用的是main.cpp下的InitCamera接口,InitCamera接口将JS侧拿到的参数进行转换再传入cameraManager.cpp中的构造函数里去,完成开启相机的操作,开启预览并设置好对焦模式。 - * 拍照和录像:开启拍照位于modeSwitchPage.ets下的isVideoPhotoFn接口,通过判断modelBagCol的值是photo还是video,将modelBagCol的值,videoId,拍照的surfaceID或者录像的surfaceId传入接口startPhotoOrVideo。如果是拍照模式,则通过modeSwitchPage.ets下的getPhotoSurfaceID接口获取photo surfaceId,跳转到main.cpp中的StartPhotoOrVideo接口,将传下来的参数进行格式转换,再调用CameraManager对象下的StartPhoto接口开启拍照操作;如果是录像模式,则通过modeSwitchPage.ets下的getVideoSurfaceID接口获取video surfaceId,跳转到main.cpp中的StartPhotoOrVideo接口,将传下来的参数进行格式转换,再调用CameraManager对象下的StartVideo接口开启录像操作 - * 前后置切换:前后置摄像头切换接口位于modeSwitchPage.ets,切换cameraDeviceIndex,将先前的session配置释放,调用cameraDemo.releaseSession接口,实际上是main.cpp下的ReleaseSession接口,最终调用到CameraMangaer.cpp下的ReleaseSession接口。然后将预览的surfaceId,对焦模式的值以及cameraDeviceIndex传入cameraDemo.initCamera接口中,逻辑和预览一致。 +* 相机预览、拍照、录像功能、前后置切换功能实现调用侧位于Index.ets,modeSwitchPage.ets,main.cpp中,源码参考:[Index.ets](entry/src/main/ets/pages/Index.ets),[ModeSwitchPage.ets](entry/src/main/ets/views/ModeSwitchPage.ets),[main.cpp](entry/src/main/cpp/main.cpp) + * 预览:开启预览位于Index.ets下的onPageShow接口,其中调用cameraDemo.initCamera接口,将预览的surfaceId,对焦模式的值,以及是前置还是后置摄像头设备作为入参啊传下去,实际调用的是main.cpp下的InitCamera接口,InitCamera接口将JS侧拿到的参数进行转换再传入cameraManager.cpp中的构造函数里去,完成开启相机的操作,开启预览并设置好对焦模式。 + * 拍照和录像:开启拍照位于ModeSwitchPage.ets下的isVideoPhotoFn接口,通过判断modelBagCol的值是photo还是video,将modelBagCol的值,videoId,拍照的surfaceID或者录像的surfaceId传入接口startPhotoOrVideo。如果是拍照模式,则通过modeSwitchPage.ets下的getPhotoSurfaceID接口获取photo surfaceId,跳转到main.cpp中的StartPhotoOrVideo接口,将传下来的参数进行格式转换,再调用CameraManager对象下的StartPhoto接口开启拍照操作;如果是录像模式,则通过modeSwitchPage.ets下的getVideoSurfaceID接口获取video surfaceId,跳转到main.cpp中的StartPhotoOrVideo接口,将传下来的参数进行格式转换,再调用CameraManager对象下的StartVideo接口开启录像操作 + * 前后置切换:前后置摄像头切换接口位于ModeSwitchPage.ets,切换cameraDeviceIndex,将先前的session配置释放,调用cameraDemo.releaseSession接口,实际上是main.cpp下的ReleaseSession接口,最终调用到CameraMangaer.cpp下的ReleaseSession接口。然后将预览的surfaceId,对焦模式的值以及cameraDeviceIndex传入cameraDemo.initCamera接口中,逻辑和预览一致。 -* 相机闪光灯、变焦、对焦、曝光功能实现调用侧位于FlashingLightPage.ets,SlidePage.ets,focusAreaPage.ets中,源码参考:[FlashingLightPage.ets](entry/src/main/cpp/ets/views/FlashingLightPage.ets),[SlidePage.ets](entry/src/main/cpp/ets/views/SlidePage.ets),[focusAreaPage.ets](entry/src/main/cpp/ets/views/focusAreaPage.ets),[main.cpp](entry/src/main/cpp/main.cpp) +* 相机闪光灯、变焦、对焦、曝光功能实现调用侧位于FlashingLightPage.ets,SlidePage.ets,focusAreaPage.ets中,源码参考:[FlashingLightPage.ets](entry/src/main/ets/views/FlashingLightPage.ets),[SlidePage.ets](entry/src/main/ets/views/SlidePage.ets),[FocusAreaPage.ets](entry/src/main/ets/views/FocusAreaPage.ets),[main.cpp](entry/src/main/cpp/main.cpp) * 闪光灯:闪光灯功能位于FlashingLightPage.ets,getImageDefault接口用作在点击闪光灯图标之后选择闪光灯模式,0代表关闭,1代表打开,2是自动,3是常亮。然后在build中通过cameraDemo.hasFlash接口调用到main.cpp中的HasFlash接口,最终调到CameraManager.cpp中的HasFlashFn接口,完成闪光灯功能的实现。 * 变焦:变焦功能位于SlidePage.ets,通过调用slideChange接口设置slide滑块的值,目前只支持1-6.然后调用cameraDemo.setZoomRatio接口调用到main.cpp中的SetZoomRatio接口,最终调到CameraManager.cpp中的setZoomRatioFn接口,完成变焦功能的实现。 - * 对焦:对焦功能位于focusAreaPage.ets,通过在build中将对焦焦点下发到cpp侧,在CameraManager.cpp文件中的SessionFlowFn函数中,会调用IsFocusMode接口来判断是否支持对焦模式,然后通过onTouch的方式将对焦点位通过cameraDemo.isFocusPoint接口下发到main.cpp侧的IsFocusPoint接口,最终调到CameraManager.cpp中的IsFocusPoint接口。以及调用OH_CaptureSession_SetFocusMode拿到对焦点位来设置对焦模式,最后调用OH_CaptureSession_GetFocusMode来获取对焦模式,完成对焦功能实现。 - * 曝光:曝光功能位于focusAreaPage.ets,通过在build中将侧光点位下发到cpp侧,然后通过onTouch的方式将对焦点位以及侧光点位通过cameraDemo.isFocusPoint接口下发到main.cpp侧的isMeteringPoint接口,最终调到CameraManager.cpp中的IsMeteringPoint接口。然后设置曝光补偿,单指竖直方向拖动触发该手势事件,调用gesture中的cameraDemo.isExposureBiasRange接口将曝光值下发到main.cpp中的IsExposureBiasRange,然后经过napi转换后将值传到CameraManager.cpp中的IsExposureBiasRange接口,之后从native侧发到曝光补偿的范围,再调用OH_CaptureSession_SetExposureBias设置曝光值,最后调用OH_CaptureSession_GetExposureBias接口获取曝光值,完成曝光功能。 + * 对焦:对焦功能位于FocusAreaPage.ets,通过在build中将对焦焦点下发到cpp侧,在CameraManager.cpp文件中的SessionFlowFn函数中,会调用IsFocusMode接口来判断是否支持对焦模式,然后通过onTouch的方式将对焦点位通过cameraDemo.isFocusPoint接口下发到main.cpp侧的IsFocusPoint接口,最终调到CameraManager.cpp中的IsFocusPoint接口。以及调用OH_CaptureSession_SetFocusMode拿到对焦点位来设置对焦模式,最后调用OH_CaptureSession_GetFocusMode来获取对焦模式,完成对焦功能实现。 + * 曝光:曝光功能位于FocusAreaPage.ets,通过在build中将侧光点位下发到cpp侧,然后通过onTouch的方式将对焦点位以及侧光点位通过cameraDemo.isFocusPoint接口下发到main.cpp侧的isMeteringPoint接口,最终调到CameraManager.cpp中的IsMeteringPoint接口。然后设置曝光补偿,单指竖直方向拖动触发该手势事件,调用gesture中的cameraDemo.isExposureBiasRange接口将曝光值下发到main.cpp中的IsExposureBiasRange,然后经过napi转换后将值传到CameraManager.cpp中的IsExposureBiasRange接口,之后从native侧发到曝光补偿的范围,再调用OH_CaptureSession_SetExposureBias设置曝光值,最后调用OH_CaptureSession_GetExposureBias接口获取曝光值,完成曝光功能。 ### 相关权限 diff --git a/code/BasicFeature/Media/Image/README_zh.md b/code/BasicFeature/Media/Image/README_zh.md index 7ac1353f0b3bbcea1659ef6e8b112a4a87e63cde..625fb72f5213e7b8a6dcc563e249e90db5635ce7 100644 --- a/code/BasicFeature/Media/Image/README_zh.md +++ b/code/BasicFeature/Media/Image/README_zh.md @@ -3,8 +3,7 @@ ### 介绍 本示例使用 [TextArea](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-textarea.md) -实现多文本输入,使用 [@ohos.app.ability.common](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ability-kit/js-apis-app-ability-common.md) -依赖系统的图库引用,实现在相册中获取图片,使用 [@ohos.multimedia.image](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-image-kit/js-apis-image.md) +实现多文本输入,使用 [@ohos.file.photoAccessHelper](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper.md)拉起图库,实现在相册中获取图片,使用 [@ohos.multimedia.image](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-image-kit/js-apis-image.md) 生成pixelMap,使用pixelMap的scale(),crop(),rotate()接口实现对图片的缩放,裁剪,旋转功能。 使用[@ohos.effectKit](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkgraphics2d/js-apis-effectKit.md) 生成effectKit,使用effectKit.getHighestSaturationColor() @@ -75,7 +74,7 @@ photomodify/src/main/ets/components ### 具体实现 + 图片选择功能在GetPictures中实现,源码参考[GetPictures.ets](entry%2Fsrc%2Fmain%2Fets%2Fpages%2FGetPictures.ets): - + 图片选择:首先使用startAbilityForResult()启动系统图库应用,然后将选择的图片用select数组保存路径,展示到页面便于选择,选择完跳转到首页,点击一张图片,进入到编辑删除界面。 + + 图片选择:首先使用[@ohos.file.photoAccessHelper](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper.md)拉起图库选择图片,然后将选择的图片用select数组保存路径,展示到页面便于选择,选择完跳转到首页,点击一张图片,进入到编辑删除界面。 + 图片编辑功能在EditImage中实现,源码参考[EditImage.ets](photomodify%2Fsrc%2Fmain%2Fets%2Fcomponents%2Fpages%2FEditImage.ets): + 图片编辑:图片编辑权限需要使用[requestPermissionsFromUser](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ability-kit/js-apis-abilityAccessCtrl.md#requestpermissionsfromuser9) 申请,源码参考[MainAbility.ts](entry/src/main/ets/MainAbility/MainAbility.ts) @@ -90,11 +89,7 @@ photomodify/src/main/ets/components ### 相关权限 -[ohos.permission.READ_MEDIA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionread_media) - -[ohos.permission.WRITE_MEDIA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionwrite_media) - -[ohos.permission.MEDIA_LOCATION](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionmedia_location) +[ohos.permission.READ_IMAGEVIDEO](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionread_imagevideo) ### 依赖 diff --git a/code/BasicFeature/Media/Image/entry/src/main/ets/MainAbility/MainAbility.ts b/code/BasicFeature/Media/Image/entry/src/main/ets/MainAbility/MainAbility.ts index 50b164fcbeacf2dc989c527f65111c93c2f31bae..6341a3f70035e26146c6e402369d43f8be27a874 100644 --- a/code/BasicFeature/Media/Image/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/code/BasicFeature/Media/Image/entry/src/main/ets/MainAbility/MainAbility.ts @@ -25,8 +25,7 @@ export default class MainAbility extends UIAbility { logger.info(TAG, '[Demo] MainAbility onCreate'); let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); try { - atManager.requestPermissionsFromUser(this.context, - ['ohos.permission.READ_MEDIA', 'ohos.permission.WRITE_MEDIA', 'ohos.permission.MEDIA_LOCATION']) + atManager.requestPermissionsFromUser(this.context, ['ohos.permission.READ_IMAGEVIDEO']) .then((data) => { logger.info(TAG, `data: ${JSON.stringify(data)}`); }).catch((err) => { diff --git a/code/BasicFeature/Media/Image/entry/src/main/ets/pages/GetPictures.ets b/code/BasicFeature/Media/Image/entry/src/main/ets/pages/GetPictures.ets index b009a0a73bd603141c689afcf74ed260845436dc..54235006c4a4b7102fcffd39e7d28d17e592c369 100644 --- a/code/BasicFeature/Media/Image/entry/src/main/ets/pages/GetPictures.ets +++ b/code/BasicFeature/Media/Image/entry/src/main/ets/pages/GetPictures.ets @@ -13,47 +13,31 @@ * limitations under the License. */ -import common from '@ohos.app.ability.common'; -import Want from '@ohos.app.ability.Want'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { logger } from '@ohos/photomodify'; +import { photoAccessHelper } from '@kit.MediaLibraryKit'; -const LENGTH_START: number = 0; const LENGTH: number = 9; +const TAG: string = '[GetPictures]'; export default class GetPictures { async getImage(): Promise { return new Promise(async (resolve, reject) => { - let mContext: common.UIAbilityContext = getContext(this) as common.UIAbilityContext; - let abilityResult: common.AbilityResult = await mContext.startAbilityForResult( - { - bundleName: 'com.ohos.photos', - abilityName: 'com.ohos.photos.MainAbility', - parameters: { - uri: 'multipleselect', - filterMediaType: 'FILTER_MEDIA_TYPE_IMAGE', - maxSelectCount: LENGTH - } - } - ); - let want: Want | undefined = abilityResult.want; - if (want !== null && want !== undefined) { - let param: Want | undefined = want.parameters; - if (param !== null && param !== undefined) { - let result: Array = param['select-item-list'] as Array; - let select: Array = []; - if (result.length === LENGTH) { - for (let i: number = LENGTH_START; i < LENGTH; i++) { - select.push(result[i]); - } - } else { - result.forEach(item => { - select.push(item); - }) - } - let imageList:Array = AppStorage.Get('imageList') as Array; - AppStorage.setOrCreate>('imageList', imageList.concat(select)); - } + try { + let photoSelectOptions = new photoAccessHelper.PhotoSelectOptions(); + photoSelectOptions.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE; + photoSelectOptions.maxSelectNumber = LENGTH; + let photoPicker = new photoAccessHelper.PhotoViewPicker(); + let photoSelectResult = await photoPicker.select(photoSelectOptions); + logger.info(TAG, 'PhotoViewPicker.select successfully, PhotoSelectResult uris: ' + JSON.stringify(photoSelectResult)); + let imageList: Array = AppStorage.get('imageList') as Array; + AppStorage.setOrCreate>('imageList', imageList.concat(photoSelectResult.photoUris)); + resolve(); + } catch (error) { + let err: BusinessError = error as BusinessError; + logger.error(TAG, `PhotoViewPicker failed with err: ${err.code}, ${err.message}`); + reject(); } - resolve(); }) } } \ No newline at end of file diff --git a/code/BasicFeature/Media/Image/entry/src/main/ets/pages/Index.ets b/code/BasicFeature/Media/Image/entry/src/main/ets/pages/Index.ets index 772c5cbe16c71fd0c4b78c8dc8facdab71cc3379..aafec1e29d356d4269615619f40d6ab855fde8a6 100644 --- a/code/BasicFeature/Media/Image/entry/src/main/ets/pages/Index.ets +++ b/code/BasicFeature/Media/Image/entry/src/main/ets/pages/Index.ets @@ -41,14 +41,15 @@ struct Index { aboutToAppear(): void { logger.info(TAG, 'enter aboutToAppear'); - if (AppStorage.Get('pixelMaps')) { + if (AppStorage.get('pixelMaps')) { this.pixelMaps.push(undefined); } let rawFile = getContext().resourceManager.getRawFdSync("commodity.png"); let imageSourceApi = image.createImageSource(rawFile); imageSourceApi.createPixelMap().then((pixelMap) => { this.commodityPixelMap = pixelMap; - }) + }); + this.imageListChange(); } async imageListChange(): Promise { diff --git a/code/BasicFeature/Media/Image/entry/src/main/module.json5 b/code/BasicFeature/Media/Image/entry/src/main/module.json5 index 9a9c8b35ec94d67c4453e1f94d51797f5a2e47c8..d8758b2081d4c6b6e31f01123a1ad1590772cc21 100644 --- a/code/BasicFeature/Media/Image/entry/src/main/module.json5 +++ b/code/BasicFeature/Media/Image/entry/src/main/module.json5 @@ -56,28 +56,8 @@ ], "requestPermissions": [ { - "name": "ohos.permission.READ_MEDIA", - "reason": "$string:media_read_permission", - "usedScene": { - "abilities": [ - "MainAbility" - ], - "when": "inuse" - } - }, - { - "name": "ohos.permission.WRITE_MEDIA", - "reason": "$string:media_write_permission", - "usedScene": { - "abilities": [ - "MainAbility" - ], - "when": "inuse" - } - }, - { - "name": "ohos.permission.MEDIA_LOCATION", - "reason": "$string:media_location_permission", + "name": 'ohos.permission.READ_IMAGEVIDEO', + "reason": "$string:read_imagevideo_permission", "usedScene": { "abilities": [ "MainAbility" diff --git a/code/BasicFeature/Media/Image/entry/src/main/resources/base/element/string.json b/code/BasicFeature/Media/Image/entry/src/main/resources/base/element/string.json index 28fb83ad5ae342c0f869cc33a688248d9001bb28..26f4e9a6af863aad7c27eb5a55777475e9e5def6 100644 --- a/code/BasicFeature/Media/Image/entry/src/main/resources/base/element/string.json +++ b/code/BasicFeature/Media/Image/entry/src/main/resources/base/element/string.json @@ -37,16 +37,8 @@ "value": "add picture/photo" }, { - "name": "media_read_permission", - "value": "Allows applications to read media files from external storage" - }, - { - "name": "media_write_permission", - "value": "allow applications can read and write media files stored in external storage" - }, - { - "name": "media_location_permission", - "value": "allows applications to access location information in user media files" + "name": "read_imagevideo_permission", + "value": "Allows applications to read image or video files from a user's public directory" } ] } \ No newline at end of file diff --git a/code/BasicFeature/Media/Image/entry/src/main/resources/en/element/string.json b/code/BasicFeature/Media/Image/entry/src/main/resources/en/element/string.json index 28fb83ad5ae342c0f869cc33a688248d9001bb28..26f4e9a6af863aad7c27eb5a55777475e9e5def6 100644 --- a/code/BasicFeature/Media/Image/entry/src/main/resources/en/element/string.json +++ b/code/BasicFeature/Media/Image/entry/src/main/resources/en/element/string.json @@ -37,16 +37,8 @@ "value": "add picture/photo" }, { - "name": "media_read_permission", - "value": "Allows applications to read media files from external storage" - }, - { - "name": "media_write_permission", - "value": "allow applications can read and write media files stored in external storage" - }, - { - "name": "media_location_permission", - "value": "allows applications to access location information in user media files" + "name": "read_imagevideo_permission", + "value": "Allows applications to read image or video files from a user's public directory" } ] } \ No newline at end of file diff --git a/code/BasicFeature/Media/Image/entry/src/main/resources/zh/element/string.json b/code/BasicFeature/Media/Image/entry/src/main/resources/zh/element/string.json index e10559c3c022e8c049d07c9e136a05e073be16c0..637fc090a8233194745c26369bda6de59ddf7e0d 100644 --- a/code/BasicFeature/Media/Image/entry/src/main/resources/zh/element/string.json +++ b/code/BasicFeature/Media/Image/entry/src/main/resources/zh/element/string.json @@ -37,16 +37,8 @@ "value": "添加图片/照片" }, { - "name": "media_read_permission", - "value": "允许应用读取用户外部存储中的媒体文件信息" - }, - { - "name": "media_write_permission", - "value": "允许应用读写用户外部存储中的媒体文件信息" - }, - { - "name": "media_location_permission", - "value": "允许应用访问用户媒体文件中的地理位置信息" + "name": "read_imagevideo_permission", + "value": "允许读取用户公共目录的图片或视频文件" } ] } \ No newline at end of file diff --git a/code/BasicFeature/Media/Image/hvigor/hvigor-config.json5 b/code/BasicFeature/Media/Image/hvigor/hvigor-config.json5 index 9dda70c28ba04933a49f4ca30c31b8d4f448d0f6..0581bec7d6eae73c8da556e3d2b4f0b4c2843808 100644 --- a/code/BasicFeature/Media/Image/hvigor/hvigor-config.json5 +++ b/code/BasicFeature/Media/Image/hvigor/hvigor-config.json5 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,8 +13,8 @@ * limitations under the License. */ { - "hvigorVersion": "4.0.2", + "hvigorVersion": "4.1.2", "dependencies": { - "@ohos/hvigor-ohos-plugin": "4.0.2" + "@ohos/hvigor-ohos-plugin": "4.1.2" } } \ No newline at end of file diff --git a/code/BasicFeature/Media/Image/photomodify/src/main/ets/components/pages/UpdatePage.ets b/code/BasicFeature/Media/Image/photomodify/src/main/ets/components/pages/UpdatePage.ets index 41d6f980c75e84f388a4c0ee4a1c65d31efd974e..24c9dcb2d587223a6e97950fa4635a4379131c0c 100644 --- a/code/BasicFeature/Media/Image/photomodify/src/main/ets/components/pages/UpdatePage.ets +++ b/code/BasicFeature/Media/Image/photomodify/src/main/ets/components/pages/UpdatePage.ets @@ -86,8 +86,8 @@ export struct UpdatePage { .width($r('app.float.size_100')) .onClick(() => { // 删除图片 - let imageList: Array = AppStorage.Get('imageList') as Array; - let index: number = AppStorage.Get('selectIndex') as number; + let imageList: Array = AppStorage.get('imageList') as Array; + let index: number = AppStorage.get('selectIndex') as number; imageList.splice(index, 1); AppStorage.setOrCreate>('imageList', imageList); // 返回 diff --git a/code/BasicFeature/Media/Image/photomodify/src/main/ets/components/util/FileUtil.ets b/code/BasicFeature/Media/Image/photomodify/src/main/ets/components/util/FileUtil.ets index bbcc71e34502ef4d8f8247439fc3a3fc217755ec..e0b9cb654c6c7f541f9315b4ae00c9aa8b002d7b 100644 --- a/code/BasicFeature/Media/Image/photomodify/src/main/ets/components/util/FileUtil.ets +++ b/code/BasicFeature/Media/Image/photomodify/src/main/ets/components/util/FileUtil.ets @@ -74,8 +74,8 @@ async function saveFile(context: Context, data: ArrayBuffer): Promise { function setImageList(uri: string) { - let imageList: Array | undefined = AppStorage.Get('imageList'); - const index: number | undefined = AppStorage.Get('selectIndex'); + let imageList: Array | undefined = AppStorage.get('imageList'); + const index: number | undefined = AppStorage.get('selectIndex'); if (imageList !== undefined && index !== undefined) { imageList[index] = uri; } diff --git a/code/BasicFeature/Media/QRCodeScan/README_zh.md b/code/BasicFeature/Media/QRCodeScan/README_zh.md index c1c0ede28aded94fdf27674bc56567aeb5ab3825..226d987ccdeaa021748720d707618a1a4d5c3c57 100644 --- a/code/BasicFeature/Media/QRCodeScan/README_zh.md +++ b/code/BasicFeature/Media/QRCodeScan/README_zh.md @@ -39,7 +39,7 @@ Feature/src/main/ets/ + 获取相机输出流:使用getSupportedOutputCapability查询相机设备在模式下支持的输出能力,然后使用createPreviewOutput创建相机输出流,使用[@ohos.multimedia.image](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-image-kit/js-apis-image.md)接口的createPhotoOutput方法创建相片输出流; + 获取相片输出:首先使用createCaptureSession方法创建**捕获会话**的实例,然后使用beginConfig方法配置会话,接下来使用addInput方法添加一个摄像头输入流,使用addOutput添加一个摄像头和相机照片的输出流,使用commitConfig方法提交会话配置后,调用start方法开始捕获相片输出。 + 二维码解析功能在QRCodeParser中,源码参考[QRCodeParser](Feature/src/main/ets/qrcodescan/QRCodeParser.ets) - + 拍照获取图片:使用[cameraService.imageReceiver.on](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-image-kit/js-apis-image.md#on9)接收图片时注册回调,然后调用readNextImage获取处理图片的操作,然后使用getComponent方法根据图像的组件类型从图像中获取组件缓存,然后将获取到的ArrayBuffer写入指定文件中,返回文件uri,然后通过[ImageBitmap](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-imagebitmap.md)将uri转化为ImageBitMap格式,具体文件写入方式参考[@ohos.file.fs](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-file-fs.md)。 + + 拍照获取图片:使用[cameraService.imageReceiver.on](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-image-kit/js-apis-image.md#on9)接收图片时注册回调,然后调用readNextImage获取处理图片的操作,然后使用getComponent方法根据图像的组件类型从图像中获取组件缓存,然后将获取到的ArrayBuffer写入指定文件中,返回文件uri,然后通过[ImageBitmap](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-imagebitmap.md)将uri转化为ImageBitMap格式,具体文件写入方式参考[@ohos.file.fs](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-fs.md)。 + 打开相册选取图片:首先需要使用[startAbilityForResult](https://docs.openharmony.cn/pages/v4.0/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartabilityforresult)启动相册,具体参数及源码参考[QRCodeParser.ets]( Feature/src/main/ets/qrcodescan/components/QRCodeScanComponent.ets),将选到的图片通过ImageBitmap转化为ImageBitmap格式。 + 图片解析:使用[CanvasRenderingContext2D](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-canvasrenderingcontext2d.md)的getImageData方法创建ImageData对象将相册中获取到的图片转化为util8格式的图片,然后调用jsQR库解析图片中的二维码。 diff --git a/code/BasicFeature/Media/VideoPlay/README_zh.md b/code/BasicFeature/Media/VideoPlay/README_zh.md index bd175912cd3a02564f921db27e13d7aed09d7e9d..9fff3c8c2d09d9d957eb4ff0d0e73c52ceba0fc9 100644 --- a/code/BasicFeature/Media/VideoPlay/README_zh.md +++ b/code/BasicFeature/Media/VideoPlay/README_zh.md @@ -2,7 +2,7 @@ ### 介绍 视频播放的主要工作是将视频数据转码并输出到设备进行播放,同时管理播放任务。本文将对视频播放全流程、视频切换、视频循环播放等场景开发进行介绍说明。 -本示例主要展示了播放本地视频和网络视频相关功能,使用 [@ohos.multimedia.media](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-media-kit/js-apis-media.md),[@ohos.resourceManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-localization-kit/js-apis-resource-manager.md),[@ohos.wifiManager](https://docs.openharmony.cn/pages/v4.0/zh-cn/application-dev/reference/apis/js-apis-wifiManager.md)等接口,实现了视频播放、暂停、调节倍速、切换视频的功能;实现效果如下; +本示例主要展示了播放本地视频和网络视频相关功能,使用 [@ohos.multimedia.media](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-media-kit/js-apis-media.md),[@ohos.resourceManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-localization-kit/js-apis-resource-manager.md),[@ohos.wifiManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-wifiManager.md)等接口,实现了视频播放、暂停、调节倍速、切换视频的功能;实现效果如下; ### 效果预览 | 播放 | 暂停 | 倍速弹窗 | 视频列表 | @@ -49,7 +49,7 @@ VideoPlay/src/main/ets/ ``` ### 具体实现 -+ 视频倍速切换、暂停、播放、切换视频、视频跳转的功能接口都封装在AvPlayManager.ts,源码参考:[AvPlayManager.ts](entry%2Fsrc%2Fmain%2Fets%2Fvideomanager%2FAvPlayManager.ts); ++ 视频倍速切换、暂停、播放、切换视频、视频跳转的功能接口都封装在AvPlayManager.ts,源码参考:[AvPlayManager.ts](entry/src/main/ets/videomanager/AvPlayManager.ets); + 使用media.createAVPlayer()来获取AVPlayer对象; + 倍速切换:选择不同的倍速时调用avPlayer.setSpeed(speed: PlaybackSpeed); + 暂停、播放:点击暂停、播放时调用avPlayer.pause()、avPlayer.play(); diff --git a/code/BasicFeature/Notification/CustomCommonEvent/README_zh.md b/code/BasicFeature/Notification/CustomCommonEvent/README_zh.md index 34c955af1c96a60ff766d8bbb06dc18145cacf92..86540f44aa596ac5462fed1a081e25922ed42865 100644 --- a/code/BasicFeature/Notification/CustomCommonEvent/README_zh.md +++ b/code/BasicFeature/Notification/CustomCommonEvent/README_zh.md @@ -126,7 +126,7 @@ entry/src/main/ets/ - 设置中订阅事件模块 - 本模块主要支持指定应用订阅自定义事件。subScribeInfo新增可选属性publisherBundleName,创建订阅对象时可指定PublisherBundlerName,事件发布时,获取订阅者信息,增加校验bundleName是否等于publisherBundlerName,相等则加入事件回调方,达成只接收指定发布方发布的事件的效果。 - - 源码链接:[EntryFormAbility.ts](feature/src/main/ets/EntryFormAbility.ts),[Index.ets](src/main/ets/pages/Index.ets),[PublishCard.ets](src/main/ets/widget/pages/PublishCard.ets) + - 源码链接:[EntryFormAbility.ts](entry/src/main/ets/entryformability/EntryFormAbility.ts),[Index.ets](src/main/ets/pages/Index.ets),[PublishCard.ets](src/main/ets/widget/pages/PublishCard.ets) - 参考接口:[@ohos.commonEventManager](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-commonEventManager.md),[@ohos.hilog](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-performance-analysis-kit/js-apis-hilog.md),[@ohos.app.form.formInfo](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-form-kit/js-apis-app-form-formInfo.md),[@ohos.app.form.formBindingData](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-form-kit/js-apis-app-form-formBindingData.md),[@ohos.app.form.FormExtensionAbility](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-form-kit/js-apis-app-form-formExtensionAbility.md) diff --git a/code/BasicFeature/Resource/ResourceManager/README_zh.md b/code/BasicFeature/Resource/ResourceManager/README_zh.md index 9f8f6cd028d16d64f53f27ba8292fdf58b0e162b..d87ca685ca235a6b2ef53b2f94abcaf6672f199c 100644 --- a/code/BasicFeature/Resource/ResourceManager/README_zh.md +++ b/code/BasicFeature/Resource/ResourceManager/README_zh.md @@ -2,8 +2,8 @@ ### 介绍 -本工程使用[@ohos.app.ability.common](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-app-ability-common.md) -接口中的AbilityContext类,获取资源管理器resourceManager,使用[@ohos.resourceManager.d.ts](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md) +本工程使用[@ohos.app.ability.common](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ability-kit/js-apis-app-ability-common.md) +接口中的AbilityContext类,获取资源管理器resourceManager,使用[@ohos.resourceManager.d.ts](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-localization-kit/js-apis-resource-manager.md) 中的接口,展示了格式化字符串查询、基于指定屏幕分辨率查询媒体资源、获取系统资源管理对象等基础功能,以及展示了资源静态overlay以及运行时overlay的特性功能。 ### 效果预览 diff --git a/code/BasicFeature/TaskManagement/ContinuousTask/entry/src/main/ets/model/ContinuousTaskModel.ets b/code/BasicFeature/TaskManagement/ContinuousTask/entry/src/main/ets/model/ContinuousTaskModel.ets index d5a9c74ee85f7b686f92cdad34cf40bd0dc854b0..06291230e0d6ac498ac3539fec114840aee5656f 100644 --- a/code/BasicFeature/TaskManagement/ContinuousTask/entry/src/main/ets/model/ContinuousTaskModel.ets +++ b/code/BasicFeature/TaskManagement/ContinuousTask/entry/src/main/ets/model/ContinuousTaskModel.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -38,9 +38,9 @@ export default class ContinuousTaskModel { abilityName: 'ohos.samples.continuoustask.MainAbility', } ], - operationType: wantAgent.OperationType.START_ABILITY, + actionType: wantAgent.OperationType.START_ABILITY, requestCode: 0, - wantAgentFlags: [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] + actionFlags: [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] } wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => { diff --git a/code/DocsSample/ApplicationModels/StageModelAbilityDevelop/README_zh.md b/code/DocsSample/ApplicationModels/StageModelAbilityDevelop/README_zh.md index 85de55b6bca128d70f4062e89546fd43c29cc3e5..a930c572c670d96d67b7bf7af2be7b70d165b51f 100644 --- a/code/DocsSample/ApplicationModels/StageModelAbilityDevelop/README_zh.md +++ b/code/DocsSample/ApplicationModels/StageModelAbilityDevelop/README_zh.md @@ -276,13 +276,13 @@ Stage模型绑定FA模型ServiceAbility功能和扩展服务功能需要修改 3.本示例需要使用DevEco Studio 3.1.1 Release (Build Version: 3.1.0.501, built on June 20, 2023)及以上版本才可编译运行。 -4.本示例涉及实现ServiceExtensionAbility功能,需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://gitee.com/link?target=https%3A%2F%2Fdocs.openharmony.cn%2Fpages%2Fv3.2%2Fzh-cn%2Fapplication-dev%2Fquick-start%2Ffull-sdk-switch-guide.md%2F)。 +4.本示例涉及实现ServiceExtensionAbility功能,需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md)。 5.本示例涉及申请AllowAppUsePrivilegeExtension特权和AssociatedWakeUp特权,只有具有AllowAppUsePrivilegeExtension特权的应用才允许开发ServiceExtensionAbility,只有具有AssociatedWakeUp特权的FA模型应用才可被关联唤醒,具体申请方式可参考[应用特权配置指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/subsystems/subsys-app-privilege-config-guide.md)。 -6.本示例涉及相关权限为system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/link?target=https%3A%2F%2Fdocs.openharmony.cn%2Fpages%2Fv3.2%2Fzh-cn%2Fapplication-dev%2Fsecurity%2Fhapsigntool-overview.md%2F))。 +6.本示例涉及相关权限为system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md))。 -7.本示例类型为系统应用,需要手动配置对应级别的应用类型("app-feature": "hos_system_app")。具体可参考profile配置文件[bundle-info对象内部结构]( https://gitee.com/openharmony/docs/blob/eb73c9e9dcdd421131f33bb8ed6ddc030881d06f/zh-cn/application-dev/security/app-provision-structure.md#bundle-info%E5%AF%B9%E8%B1%A1%E5%86%85%E9%83%A8%E7%BB%93%E6%9E%84 ) +7.本示例类型为系统应用,需要手动配置对应级别的应用类型("app-feature": "hos_system_app")。具体可参考profile配置文件[bundle-info对象内部结构](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/app-provision-structure.md#bundle-info%E5%AF%B9%E8%B1%A1%E5%86%85%E9%83%A8%E7%BB%93%E6%9E%84)。 ### 下载 diff --git a/code/DocsSample/ApplicationModels/StageModelAbilityInteraction/README_zh.md b/code/DocsSample/ApplicationModels/StageModelAbilityInteraction/README_zh.md index cf1af451f6b692795b81658dfa58af2d1f5b2ced..c7c248d0d605118a91cd3ff79fe72993e36d754c 100644 --- a/code/DocsSample/ApplicationModels/StageModelAbilityInteraction/README_zh.md +++ b/code/DocsSample/ApplicationModels/StageModelAbilityInteraction/README_zh.md @@ -68,13 +68,13 @@ entry/src/main/ets/ 3.本示例需要使用DevEco Studio 3.1.1 Release (Build Version: 3.1.0.501, built on June 20, 2023)及以上版本才可编译运行。 -4.本示例涉及实现ServiceExtensionAbility功能,需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://gitee.com/link?target=https%3A%2F%2Fdocs.openharmony.cn%2Fpages%2Fv3.2%2Fzh-cn%2Fapplication-dev%2Fquick-start%2Ffull-sdk-switch-guide.md%2F)。 +4.本示例涉及实现ServiceExtensionAbility功能,需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md)。 5.本示例涉及申请AssociatedWakeUp特权,只有具有AllowAppUsePrivilegeExtension特权的应用才允许开发ServiceExtensionAbility,具体申请方式可参考[应用特权配置指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/subsystems/subsys-app-privilege-config-guide.md)。 -6.本示例涉及相关权限为system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/link?target=https%3A%2F%2Fdocs.openharmony.cn%2Fpages%2Fv3.2%2Fzh-cn%2Fapplication-dev%2Fsecurity%2Fhapsigntool-overview.md%2F))。 +6.本示例涉及相关权限为system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md))。 -7.本示例类型为系统应用,需要手动配置对应级别的应用类型("app-feature": "hos_system_app")。具体可参考profile配置文件[bundle-info对象内部结构]( https://gitee.com/openharmony/docs/blob/eb73c9e9dcdd421131f33bb8ed6ddc030881d06f/zh-cn/application-dev/security/app-provision-structure.md#bundle-info%E5%AF%B9%E8%B1%A1%E5%86%85%E9%83%A8%E7%BB%93%E6%9E%84 ) +7.本示例类型为系统应用,需要手动配置对应级别的应用类型("app-feature": "hos_system_app")。具体可参考profile配置文件[bundle-info对象内部结构](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/app-provision-structure.md#bundle-info%E5%AF%B9%E8%B1%A1%E5%86%85%E9%83%A8%E7%BB%93%E6%9E%84)。 ### 下载 diff --git a/code/DocsSample/ApplicationModels/StageProcessThread/README_zh.md b/code/DocsSample/ApplicationModels/StageProcessThread/README_zh.md index 9c29f4a40e8ceeff59dcb9f15bfc678ef578a554..45ec5fc4a8539f8ab1b5520000c505c7f8fefe6c 100644 --- a/code/DocsSample/ApplicationModels/StageProcessThread/README_zh.md +++ b/code/DocsSample/ApplicationModels/StageProcessThread/README_zh.md @@ -20,15 +20,15 @@ 2)点击[订阅灭屏公共事件],弹出toast[成功订阅灭屏公共事件]; -3)点击[发布灭屏公共事件-不携带信息],弹出toast[{"event":***}],其中data为空; +3)点击[发布灭屏公共事件-不携带信息],弹出toast[{"event":\***}],其中data为空; -4)点击[发布灭屏公共事件-携带信息],弹出toast[[{"event":***}],其中data‘为initial data’; +4)点击[发布灭屏公共事件-携带信息],弹出toast[{"event":\***}],其中data‘为initial data’; 5)点击[取消订阅灭屏公共事件],弹出toast[成功取消订阅灭屏公共事件]; 6)点击[发布灭屏粘性公共事件],弹出toast[成功发布灭屏粘性公共事件], -再点击[订阅灭屏公共事件],弹出toast[[{"event":***}],其中data为‘initial Sticky data’; +再点击[订阅灭屏公共事件],弹出toast[{"event":\***}],其中data为‘initial Sticky data’; 7)点击[移除灭屏粘性公共事件],弹出toast[成功移除灭屏粘性公共事件],再点击[取消订阅灭屏公共事件],再点击[订阅灭屏公共事件],此时弹出[成功订阅灭屏公共事件]; @@ -93,21 +93,21 @@ entry/src/main/ets/ * 源码链接:[pageProcessModel.ets](entry\src\main\ets\pages\pageProcessModel.ets) [StaticSubscriber.ts](entry\src\main\ets\staticsubscriber\StaticSubscriber.ts) [staticsubscriber.json](entry\src\main\resources\base\profile\staticsubscriber.json) - * 参考接口:[@ohos.commonEventManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-commonEventManager.md) + * 参考接口:[@ohos.commonEventManager](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-commonEventManager.md) * 了解线程模型: * 调用相关接口函数来实现使用Emitter和Worker进行线程间通信的功能。 * 源码链接: [pageThreadModel.ets](entry\src\main\ets\pages\pageThreadModel.ets) [Worker.ts](entry\src\main\ets\workers\Worker.ts) - * 参考接口:[@ohos.events.emitter](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-emitter.md) [@ohos.worker](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-worker.md) + * 参考接口:[@ohos.events.emitter](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-emitter.md) [@ohos.worker](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-arkts/js-apis-worker.md) * 任务管理: * 调用相关接口函数来实现注册/解注册任务变化通知、获取系统最近任务等管理系统任务的功能。 * 源码链接: [pageTaskManager.ets](entry\src\main\ets\pages\pageTaskManager.ets) - * 参考接口:[@ohos.application.missionManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-application-missionManager.md) + * 参考接口:[@ohos.application.missionManager](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-ability-kit/js-apis-application-missionManager-sys.md) ### 相关权限 @@ -152,11 +152,11 @@ entry/src/main/ets/ 3.本示例需要使用DevEco Studio 3.1.1 Release (Build Version: 3.1.0.501, built on June 20, 2023)及以上版本才可编译运行。 -4.本示例涉及使用系统接口:@ohos.application.missionManager,需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://gitee.com/link?target=https%3A%2F%2Fdocs.openharmony.cn%2Fpages%2Fv3.2%2Fzh-cn%2Fapplication-dev%2Fquick-start%2Ffull-sdk-switch-guide.md%2F)。 +4.本示例涉及使用系统接口:@ohos.application.missionManager,需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md)。 -5.本示例涉及相关权限为system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/link?target=https%3A%2F%2Fdocs.openharmony.cn%2Fpages%2Fv3.2%2Fzh-cn%2Fapplication-dev%2Fsecurity%2Fhapsigntool-overview.md%2F))。 +5.本示例涉及相关权限为system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md))。 -6.本示例类型为系统应用,需要手动配置对应级别的应用类型("app-feature": "hos_system_app")。具体可参考profile配置文件[bundle-info对象内部结构]( https://gitee.com/openharmony/docs/blob/eb73c9e9dcdd421131f33bb8ed6ddc030881d06f/zh-cn/application-dev/security/app-provision-structure.md#bundle-info%E5%AF%B9%E8%B1%A1%E5%86%85%E9%83%A8%E7%BB%93%E6%9E%84 ) +6.本示例类型为系统应用,需要手动配置对应级别的应用类型("app-feature": "hos_system_app")。具体可参考profile配置文件[bundle-info对象内部结构](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/app-provision-structure.md#bundle-info%E5%AF%B9%E8%B1%A1%E5%86%85%E9%83%A8%E7%BB%93%E6%9E%84) ### 下载 diff --git a/code/DocsSample/ApplicationModels/WidgetUpdateByProxy/README_zh.md b/code/DocsSample/ApplicationModels/WidgetUpdateByProxy/README_zh.md index 9167dbcdf2e3d1dbb65e0460e1202ce4b6249d67..7ad0fb783f5839cd6bf3f2efdcc8f2b42e4bab5d 100644 --- a/code/DocsSample/ApplicationModels/WidgetUpdateByProxy/README_zh.md +++ b/code/DocsSample/ApplicationModels/WidgetUpdateByProxy/README_zh.md @@ -2,7 +2,7 @@ ### 介绍 -本示例对应 [卡片代理刷新](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/application-models/arkts-ui-widget-update-by-proxy.md)中数据提供方的共享数据更新功能。 +本示例对应 [卡片代理刷新](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/form/arkts-ui-widget-update-by-proxy.md)中数据提供方的共享数据更新功能。 本示例参考[应用模型](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/application-models)。 @@ -74,7 +74,7 @@ entry/src/main/ets/ 3.本示例需要使用DevEco Studio 3.1.1 Release (Build Version: 3.1.0.501, built on June 20, 2023)及以上版本才可编译运行。 -4.本示例涉及相关权限为system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/link?target=https%3A%2F%2Fdocs.openharmony.cn%2Fpages%2Fv3.2%2Fzh-cn%2Fapplication-dev%2Fsecurity%2Fhapsigntool-overview.md%2F))。 +4.本示例涉及相关权限为system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/link?target=https%3A%2F%2Fdocs.openharmony.cn%2Fpages%2Fv3.2%2Fzh-cn%2Fapplication-dev%2Fsecurity%2Fhapsigntool-overview.md%2F))。 5.本示例类型为系统应用,需要手动配置对应级别的应用类型("app-feature": "hos_system_app")。具体可参考profile配置文件[bundle-info对象内部结构]( https://gitee.com/openharmony/docs/blob/eb73c9e9dcdd421131f33bb8ed6ddc030881d06f/zh-cn/application-dev/security/app-provision-structure.md#bundle-info%E5%AF%B9%E8%B1%A1%E5%86%85%E9%83%A8%E7%BB%93%E6%9E%84 ) diff --git a/code/DocsSample/BundleManagerDocsSample/HarSample/README_zh.md b/code/DocsSample/BundleManagerDocsSample/HarSample/README_zh.md index 793e8096e16c2709cd1de1323833072b444f778b..6ac88bfb7f8823862cd1b1113b56290c08fe1d72 100644 --- a/code/DocsSample/BundleManagerDocsSample/HarSample/README_zh.md +++ b/code/DocsSample/BundleManagerDocsSample/HarSample/README_zh.md @@ -16,7 +16,7 @@ HAR(Harmony Archive)是静态共享包,可以包含代码、C++库、资 1.启动HarSample(静态共享包)应用,首页正常显示所引用HAR的ArkUI组件、ts类和方法、native方法、资源。 -2.点击主页"引用HAR的ArkUI组件"按钮,正确引用HAR的ArkUI组件,跳转至HAR的MainPage页面,页面显示内容为:Hello World。 +2.点击主页"引用HAR的ArkUI组件"按钮,正确引用HAR的ArkUI组件,跳转至HAR的MainPage页面,页面显示内容为:暂无内容。 3.点击主页"引用HAR的ts类和方法"按钮,正确引用HAR导出的ts类和方法,页面Hello World字段变更为func return: har func。 diff --git a/code/DocsSample/BundleManagerDocsSample/HarSample/library/src/main/resources/zh_CN/element/string.json b/code/DocsSample/BundleManagerDocsSample/HarSample/library/src/main/resources/zh_CN/element/string.json index 6c874bd0dd5462b7d1a94ea914aeb099f1be3c54..16aca3484ef8485e31a8857e48a63c0b98baaa5d 100644 --- a/code/DocsSample/BundleManagerDocsSample/HarSample/library/src/main/resources/zh_CN/element/string.json +++ b/code/DocsSample/BundleManagerDocsSample/HarSample/library/src/main/resources/zh_CN/element/string.json @@ -10,7 +10,7 @@ }, { "name": "empty", - "value": "" + "value": "暂无内容" } ] } diff --git a/code/DocsSample/Form/ArkTSCardDocsSample/README_zh.md b/code/DocsSample/Form/ArkTSCardDocsSample/README_zh.md index 0623fcad63d5d5b8b26369eaa4932bbe3d51ba21..a00396dfd077ef9ec8fd99a47a1ff20401176790 100644 --- a/code/DocsSample/Form/ArkTSCardDocsSample/README_zh.md +++ b/code/DocsSample/Form/ArkTSCardDocsSample/README_zh.md @@ -5,8 +5,8 @@ 此Sample为开发指南中**服务卡片开发指导(Stage模型)**章节中**开发卡片页面**三小节示例代码的完整工程。 [卡片页面能力说明](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/application-models/arkts-ui-widget-page-overview.md) -[卡片使用动效能力](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/application-models/arkts-ui-widget-page-animation.md) -[卡片使用自定义绘制能力](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/application-models/arkts-ui-widget-page-custom-drawing.md) +[卡片使用动效能力](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/form/arkts-ui-widget-page-animation.md) +[卡片使用自定义绘制能力](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/form/arkts-ui-widget-page-custom-drawing.md) ### 效果预览 |默认卡片|动效卡片|自定义绘制卡片| @@ -113,9 +113,9 @@ [卡片页面能力说明](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/application-models/arkts-ui-widget-page-overview.md) -[卡片使用动效能力](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/application-models/arkts-ui-widget-page-animation.md) +[卡片使用动效能力](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/form/arkts-ui-widget-page-animation.md) -[卡片使用自定义绘制能力](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/application-models/arkts-ui-widget-page-custom-drawing.md) +[卡片使用自定义绘制能力](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/form/arkts-ui-widget-page-custom-drawing.md) ### 相关权限 diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/.gitignore b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..d2ff20141ceed86d87c0ea5d99481973005bab2b --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/.gitignore @@ -0,0 +1,12 @@ +/node_modules +/oh_modules +/local.properties +/.idea +**/build +/.hvigor +.cxx +/.clangd +/.clang-format +/.clang-tidy +**/.test +/.appanalyzer \ No newline at end of file diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/AppScope/app.json5 b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c781b39fe520ae70a095ab7a6b37a76ba68b2104 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/AppScope/app.json5 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "app": { + "bundleName": "com.example.arkts", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/AppScope/resources/base/element/string.json b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..7eb2bed79b504f5f9c19f9bfac18bd9256565629 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "HiTraceChain_ArkTS" + } + ] +} diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/AppScope/resources/base/media/app_icon.png b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a39445dc87828b76fed6d2ec470dd455c45319e3 Binary files /dev/null and b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/AppScope/resources/base/media/app_icon.png differ diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/README_zh.md b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..bb577192f9ac216c47a7bbb7c33fa921b7f7a88e --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/README_zh.md @@ -0,0 +1,67 @@ +# 使用HiTraceChain打点(ArkTS/JS) + +### 介绍 + +本示例主要展示了使用HiTraceChain打点(ArkTS/JS)相关的功能,HiTraceChain是基于云计算分布式跟踪调用链思想,在端侧业务流程(涉及跨线程、跨进程、跨设备)中的一种轻量级实现。hiTraceChain在业务控制面流程中,生成和传递唯一跟踪标识,在业务流程中输出的各类信息中(包括应用事件、系统时间、日志等)记录该跟踪标识。在调试、问题定位过程中,开发者可以通过该唯一跟踪标识将本次业务流程端到端的各类信息快速关联起来。hiTraceChain为开发者提供业务流程调用链跟踪的维测接口,帮助开发者迅速获取指定业务流程调用链的运行日志,定位跨设备/跨进程/跨线程的故障问题。 + +### 效果预览 + +| 主页 | +| :----------------------------------------------------------: | +| z | + +使用说明 + +1.在主界面点击按钮,切换到"Log"窗口,日志过滤选择"No filters",搜索内容设置为"HiTraceBegin"。此时窗口仅显示符合条件的日志,打印日志结果为: + +``` +[a92ab145c9421d5, 0, 0] HiTraceBegin name:Write a new app event flags:0x01. +``` + +2.再搜索形如“[a92ab145c9421d5, 0, 0]”字样的内容,即可查看所有该业务的分布式跟踪信息: + +``` +[a92ab145c9421d5, 0, 0] HiTraceBegin name:Write a new app event flags:0x01. +[a92ab145c9421d5, 0, 0] pid[24256] first get g_tagsProperty: 0 +[a92ab145c9421d5, 0, 0] [event_manager.cpp(835)-(100000:100000:scope)] id: 0, log: {types: Click, node: Button, prcd: Down, state: READY, prcd: Up, state: SUCCEED} +[a92ab145c9421d5, 0, 0] [event_manager.cpp(1817)-(100000:100000:scope)] Consumed new event id=5591 in ace_container, lastEventInfo: id:5590 +``` + +### 工程目录 + +``` +entry/src/main/ets/ +└─pages + └─---Index.ets //首页 +``` + +### 具体实现 + +- 在自己的业务中调用hiTraceChain的接口,进行性能打点跟踪。 + +### 相关权限 + +不涉及。 + +### 依赖 + +不涉及。 + +### 约束与限制 + +1. 本示例仅支持标准系统上运行,支持设备:RK3568; +2. 本示例已适配API14版本SDK,版本号:[5.0.2.58](http://5.0.2.58),镜像版本号:OpenHarmony5.0.2.58; +3. 本示例需要使用DevEco Studio (5.0.3.910)及以上版本才可编译运行。 + +### 下载 + +如需单独下载本工程,执行如下命令: + +``` +git init +git config core.sparsecheckout true +echo code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/ > .git/info/sparse-checkout +git remote add origin https://gitee.com/openharmony/applications_app_samples.git +git pull origin master +``` + diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/build-profile.json5 b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..0774ee6b6a889b824b693e1d6ef0bcdb17c56ffb --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/build-profile.json5 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": 14, + "compileSdkVersion": 14, + "targetSdkVersion": 14, + "runtimeOS": "OpenHarmony" + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/.gitignore b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/build-profile.json5 b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..63b88fb1a0053e40acb2391457a7e9d71af748fe --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/build-profile.json5 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/hvigorfile.ts b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..ac00aaeaf45982325e06e5a576ed7c336bbdb351 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/hvigorfile.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/obfuscation-rules.txt b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..fdbb5b9852d7dd5f39bddaeb21ab5ee1f3346749 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/obfuscation-rules.txt @@ -0,0 +1,22 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/oh-package.json5 b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..4e54d14e1b444a338b2c922f94a4fe4deed5be45 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/oh-package.json5 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/ets/entryability/EntryAbility.ets b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..217744d8eb6d893e1138cd660209ce4d0441ac4f --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..6b744d7eaa66e51e79fc4e0896e251292ee767c5 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/ets/pages/Index.ets b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..c3d32eb86d55dec9908b568ae0b4c80c88c63461 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { BusinessError } from '@kit.BasicServicesKit'; +import { hiAppEvent, hilog, hiTraceChain } from '@kit.PerformanceAnalysisKit'; + +@Entry +@Component +struct Index { + @State message: string = 'HiTraceChain ArkTS' + + build() { + Row() { + Column() { + Button(this.message) + .type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .width('60%') + .height('5%') + .onClick(() => { + try { + // 业务开始前,开启分布式跟踪。 + let traceId = hiTraceChain.begin("Write a new app event", hiTraceChain.HiTraceFlag.INCLUDE_ASYNC) + // 在按钮点击函数中进行事件打点,以记录按钮点击事件 + let eventParams: Record = { 'click_time': 100 } + let eventInfo: hiAppEvent.AppEventInfo = { + // 事件领域定义 + domain: "button", + // 事件名称定义 + name: "click", + // 事件类型定义 + eventType: hiAppEvent.EventType.BEHAVIOR, + // 事件参数定义 + params: eventParams, + } + hiAppEvent.write(eventInfo).then(() => { + hilog.info(0x0000, 'testTag', `Succeed to write an app event`) + // 业务结束,关闭分布式跟踪。 + hiTraceChain.end(traceId) + }).catch((err: BusinessError) => { + hilog.error(0x0000, 'testTag', `HiAppEvent err.code: ${err.code}, err.message: ${err.message}`) + }) + } catch (err) { + console.error(`error message is ${(err as BusinessError).message}`) + } + }) + } + .width('100%') + } + .height('100%') + } +} diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/module.json5 b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..cb5df2316a385286bf09b1aab230f0bf56d8b993 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/module.json5 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:layered_image", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "name": "EntryBackupAbility", + "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", + "type": "backup", + "exported": false, + "metadata": [ + { + "name": "ohos.extension.backup", + "resource": "$profile:backup_config" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/element/color.json b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/element/string.json b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e10d082d92c988acb0398f51c165fc1a0a75c9b3 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "HiTraceChain_ArkTS" + } + ] +} \ No newline at end of file diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/media/background.png b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..f939c9fa8cc8914832e602198745f592a0dfa34d Binary files /dev/null and b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/media/background.png differ diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/media/foreground.png b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..4483ddad1f079e1089d685bd204ee1cfe1d01902 Binary files /dev/null and b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/media/foreground.png differ diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/media/layered_image.json b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/media/layered_image.json @@ -0,0 +1,7 @@ +{ + "layered-image": + { + "background" : "$media:background", + "foreground" : "$media:foreground" + } +} \ No newline at end of file diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/media/startIcon.png b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/media/startIcon.png differ diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/profile/backup_config.json b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/profile/main_pages.json b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/en_US/element/string.json b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e10d082d92c988acb0398f51c165fc1a0a75c9b3 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "HiTraceChain_ArkTS" + } + ] +} \ No newline at end of file diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/zh_CN/element/string.json b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c20d7c9fb38cffcb9e847c513587cdb7637c01d5 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "HiTraceChain_ArkTS" + } + ] +} \ No newline at end of file diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/mock/mock-config.json5 b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/mock/mock-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..26ed9f53bc46192a07ad5ab16ea24e7ce9a79328 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/entry/src/mock/mock-config.json5 @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ +} \ No newline at end of file diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/hvigor/hvigor-config.json5 b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..76e3231223076011f7f4400f54fa73a5ab0141d4 --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/hvigor/hvigor-config.json5 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */ + // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ + // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ + // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ + }, + "nodeOptions": { + // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/ + // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/ + } +} diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/hvigorfile.ts b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..804bc34627caf7f0ce6395bc21fec0d24510b7db --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/hvigorfile.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/oh-package.json5 b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..a941f4458316c00220a8f9a3b0c15342b6b6255b --- /dev/null +++ b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/oh-package.json5 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.18", + "@ohos/hamock": "1.0.0" + } +} diff --git a/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/screenshots/Screenshot_20241217163807312.jpeg b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/screenshots/Screenshot_20241217163807312.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..cdc918ee7e62ebee249fb37b61c4c1af1636827e Binary files /dev/null and b/code/DocsSample/PerformanceAnalysisKit/HiTraceChain/ArkTS/screenshots/Screenshot_20241217163807312.jpeg differ diff --git a/code/LaunguageBaseClassLibrary/ConcurrentModule/README_zh.md b/code/LaunguageBaseClassLibrary/ConcurrentModule/README_zh.md index bf79951ae0884c93744b4dce9c309c4eeba99129..ac511faabaaf46b26f01e1d6fbb105abe0e026e8 100644 --- a/code/LaunguageBaseClassLibrary/ConcurrentModule/README_zh.md +++ b/code/LaunguageBaseClassLibrary/ConcurrentModule/README_zh.md @@ -2,8 +2,8 @@ ### 介绍 -本示例通过[@ohos.taskpool](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-taskpool.md) -和[@ohos.worker](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-worker.md) 接口,展示了如何启动worker线程和taskpool线程。 +本示例通过[@ohos.taskpool](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkts/js-apis-taskpool.md) +和[@ohos.worker](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkts/js-apis-worker.md) 接口,展示了如何启动worker线程和taskpool线程。 ### 效果预览 @@ -83,7 +83,7 @@ entry/src/main/ets/ * 内存共享的实现在taskpool页面调用,源码参考[TaskPoolTab.ets](entry/src/main/ets/component/TaskPoolTab.ets) -* 批量拷贝文件的功能封装在MyWorker,源码参考:[MyWorker.ts](ets/src/main/ets/fileFs/MyWorker.ts) +* 批量拷贝文件的功能封装在MyWorker,源码参考:[MyWorker.ets](entry/src/main/ets/fileFs/MyWorker.ets) * 拷贝文件:在[CopyFile.ets](entry/src/main/ets/pages/CopyFile.ets) diff --git a/code/LaunguageBaseClassLibrary/ZipLib/README_zh.md b/code/LaunguageBaseClassLibrary/ZipLib/README_zh.md index 70203679aa2560d704a4ed328bfb21e0a9190380..02c6b682d98c3b609fe3a5544a0e7ba546a8ff91 100644 --- a/code/LaunguageBaseClassLibrary/ZipLib/README_zh.md +++ b/code/LaunguageBaseClassLibrary/ZipLib/README_zh.md @@ -3,7 +3,7 @@ ### 介绍 本示例通过[@ohos.zlib](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-zlib.md) -和[@ohos.fileio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-fileio.md) 接口,实现添加文件、解压和压缩文件场景。 +和[@ohos.fileio](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-fileio.md) 接口,实现添加文件、解压和压缩文件场景。 ### 效果预览 diff --git a/code/Performance/ArkRuntime/NBody/README_zh.md b/code/Performance/ArkRuntime/NBody/README_zh.md index 57e50144d1dd77ab536917b4c34432522d85bd27..9ba862ff32da6fbbe04ce1958ab9eda897298de0 100644 --- a/code/Performance/ArkRuntime/NBody/README_zh.md +++ b/code/Performance/ArkRuntime/NBody/README_zh.md @@ -4,7 +4,7 @@ 在本示例中,使用ArkTS编程语言开发了业界编程语言基准测试项目[Benchmarks Game](https://salsa.debian.org/benchmarksgame-team/benchmarksgame/)中的[N体问题模拟程序](https://benchmarksgame-team.pages.debian.net/benchmarksgame/description/nbody.html#nbody),实现类木星体轨道计算。 -本示例用到了[@ohos.taskpool](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-taskpool.md)和[@ohos.worker](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-worker.md) 接口。示例中的程序可以用于AOT(Ahead Of Time)等性能测试。 +本示例用到了[@ohos.taskpool](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-arkts/js-apis-taskpool.md)和[@ohos.worker](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-arkts/js-apis-worker.md) 接口。示例中的程序可以用于AOT(Ahead Of Time)等性能测试。 ### 效果预览 |主页|计算中|重复点击|计算结果| @@ -47,7 +47,7 @@ AOT(Ahead Of Time),即预先编译,在应用程序运行前,将代码预 - 使用Worker开启子线程运行,计算5000万次时间推计算移天体运行轨道,源码参考[CalculateUtil.ets ](entry/src/main/ets/model/CalculateUtil.ets ) - 通过调用computeNBodyByWorker()创建一个worker线程,把要计算的时间推移量发送给worker线程。 - 等待worker线程调用computeTask()计算完成后再把结果返回主线程。 -- computeTask()完成具体计算任务,源码参考[NBody_ETS_6.ets](entry/src/main/ets/model/NBody_ETS_6.ets) +- computeTask()完成具体计算任务,源码参考[NBody_ETS_6.ets](entry/src/main/ets/model/NBody_ETS_6.ets) - offsetMomentum() 建立孤立系统的动量守恒。 - advance() 更新天体在按指定的时间变化后的位置信息。 - energy() 判断系统计算前后机械能守恒。 diff --git a/code/Project/ApplicationHap/MultiHap/README_zh.md b/code/Project/ApplicationHap/MultiHap/README_zh.md index 02eb7955c47f69a2dc757b34f7edcfe17af3ade9..2ab427b0c961cc2c499b06190773e677ead16e2e 100644 --- a/code/Project/ApplicationHap/MultiHap/README_zh.md +++ b/code/Project/ApplicationHap/MultiHap/README_zh.md @@ -5,8 +5,8 @@ 本示例展示多HAP开发,简单介绍了多HAP的使用场景,应用包含了一个entry HAP和两个feature HAP,两个feature HAP分别提供了音频和视频播放组件,entry中使用了音频和视频播放组件。 三个模块需要安装三个hap包,最终会在设备上安装一个主entry的hap包。 -本示例用到了应用上下文Context接口 [@ohos.app.ability.common](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-app-ability-common.md) -媒体服务接口[@ohos.multimedia.media](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-media.md) +本示例用到了应用上下文Context接口 [@ohos.app.ability.common](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-ability-kit/js-apis-app-ability-common.md) +媒体服务接口[@ohos.multimedia.media](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-media-kit/js-apis-media.md) ### 效果预览 @@ -102,12 +102,9 @@ feature:应用的特性模块,一个应用中可以包含一个或者多个f 如需单独下载本工程,执行如下命令: ``` - git init git config core.sparsecheckout true echo code/Project/ApplicationHap/MultiHap/ > .git/info/sparse-checkout git remote add origin https://gitee.com/openharmony/applications_app_samples.git git pull origin master - ``` - diff --git a/code/Project/Test/jsunit/README_zh.md b/code/Project/Test/jsunit/README_zh.md index 25a7056409bbf4768d9a3153a99572b446d2ba55..05e3edd7fb8cdea50690e8d4a52424d62acea926 100644 --- a/code/Project/Test/jsunit/README_zh.md +++ b/code/Project/Test/jsunit/README_zh.md @@ -5,7 +5,7 @@ 本实例用到了自动化测试框架代码部件仓arkXtest,测试框架的详细介绍[arkXtest](https://gitee.com/openharmony/testfwk_arkxtest#%E4%BD%BF%E7%94%A8%E6%96%B9%E5%BC%8F) 。 -如需日志打印调试,需要引入日志打印接口[@ohos.hilog](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-hilog.md) 。 +如需日志打印调试,需要引入日志打印接口[@ohos.hilog](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-performance-analysis-kit/js-apis-hilog.md)。 单元测试用例相较于UI自动化测试用例而言更偏重于接口返回数据的校验及逻辑处理。 diff --git a/code/Project/Test/uitest/README_zh.md b/code/Project/Test/uitest/README_zh.md index fc3355a97b1ca9398788d89320eff18359112501..17eed6c6cee49dd290641345097363bef41716d7 100644 --- a/code/Project/Test/uitest/README_zh.md +++ b/code/Project/Test/uitest/README_zh.md @@ -4,9 +4,9 @@ 测试框架arkxtest的详细介绍请[参考](https://gitee.com/openharmony/testfwk_arkxtest) 。 -本实例需要引入UiTest接口[@ohos.UiTest](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-uitest.md) 。 +本实例需要引入UiTest接口[@ohos.UiTest](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-test-kit/js-apis-uitest.md) 。 -如需日志打印调试,需要引入日志打印接口[@ohos.hilog](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-hilog.md) 。 +如需日志打印调试,需要引入日志打印接口[@ohos.hilog](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-performance-analysis-kit/js-apis-hilog.md) 。 其中自动化测试用例编写规范文档,请[参考](https://gitee.com/openharmony/applications_app_samples/blob/master/CodeCommitChecklist.md#ui%E8%87%AA%E5%8A%A8%E5%8C%96%E7%94%A8%E4%BE%8B%E7%BC%96%E5%86%99%E8%A7%84%E8%8C%83) 。 diff --git a/code/Solutions/Game/Game2048/README_zh.md b/code/Solutions/Game/Game2048/README_zh.md index 0d1113a9aabada3531113b826328b8706b3ffd1d..f00e6a4ded089ea03ae777cec92fcf86147d295b 100644 --- a/code/Solutions/Game/Game2048/README_zh.md +++ b/code/Solutions/Game/Game2048/README_zh.md @@ -4,9 +4,9 @@ 本示例使用Grid组件,实现了2048小游戏功能。 -需要系统存储信息,运用了用户首选项接口[ohos.data.preferences](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md) , +需要系统存储信息,运用了用户首选项接口[ohos.data.preferences](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkdata/js-apis-data-preferences.md) , -屏幕属性接口[@ohos.display](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-display.md#displaygetdefaultdisplaydeprecated) 。 +屏幕属性接口[@ohos.display](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/js-apis-display.md) 。 ### 效果预览 @@ -40,7 +40,7 @@ entry/src/main/ets/ * 界面编写步骤 1、使用Grid编写网格界面,并在下方编写start按钮触发gameStart()函数生成gridItem所需数据,并且将游戏状态修改为游戏中,触发游戏规则Init()初始化游戏规则。 2、循环渲染gridItem,去生成网格数据,MyGridItem会根据每一个数据渲染每一个网格的数字颜色(<=4?黑:白)和背景色(通过自然对数计算出颜色数组中的当前索引)。 - 3、grid通过gesture()去绑定一组手势up,down,left,right函数, [源码参考](entry/src/main/ets/pages/Index.ets )。 + 3、grid通过gesture()去绑定一组手势up,down,left,right函数, [源码参考](entry/src/main/ets/pages/Index.ets )。 * 游戏规则编写 1、init()函数初始化游戏规则,将所有网格数字设置为0,游戏状态为开始,分数为0,并生成网格数字。[源码参考](entry/src/main/ets/model/GameRule.ets )。 2、触发up/down函数,网格沿着colnum移动,最多可移动三次(row大小-1次),如果当前网格数字===要移动到的网格上的数字,就将要移动的网格数字 + 当前网格数字,将结果加上旧score赋值给最新的score, diff --git a/code/Solutions/IM/Chat/README_zh.md b/code/Solutions/IM/Chat/README_zh.md index 1237899c9d0d489bcaf3f87c1c73711e0c62e17d..cb7c7204bed438ceee23f38b359236b01622c86c 100644 --- a/code/Solutions/IM/Chat/README_zh.md +++ b/code/Solutions/IM/Chat/README_zh.md @@ -4,9 +4,9 @@ 这是一个仿聊天类应用,使用了静态布局搭建了不同的页面。为了优化内存与性能体验,在部分list场景使用了懒加载。 -本示例用到了 图片处理能力接口[@ohos.multimedia.image](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md )。 +本示例用到了 图片处理能力接口[@ohos.multimedia.image](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-image-kit/js-apis-image.md)。 -文件存储管理能力接口[@ohos.fileio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-fileio.md) 。 +文件存储管理能力接口[@ohos.fileio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-fileio.md) 。 ### 效果预览 | 主页 | 通讯录 | 发现 | 个人页面 | @@ -68,7 +68,7 @@ products/phone/entry/src/main/ets 懒加载:开发框架提供数据懒加载(LazyForEach组件)从提供的数据源中按需迭代数据,并在每次迭代过程中创建相应的组件。 -多线程:开发框架提供[多线程并发能力](https://docs.openharmony.cn/pages/v4.0/zh-cn/application-dev/performance/multi_thread_capability.md/),允许在同一时间段内同时执行多段代码,进行大量或调度点较分散的任务开发和处理。 +多线程:开发框架提供[多线程并发能力](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/performance/multi_thread_capability.md/),允许在同一时间段内同时执行多段代码,进行大量或调度点较分散的任务开发和处理。 ### 具体实现 @@ -110,14 +110,14 @@ url: 'pages/SearchPage' })。 } ``` 3. 从设备端采集热点ap文件: - - 通过命令行开启设备ap文件开关。 - ```shell - hdc shell param set ark.profile true - ``` - - 将应用按步骤1中release模式打包出hap并安装到设备上,在需要优化的场景进行操作,记录高频操作后,通过命令行导出ap文件。 - ```shell - hdc file recv /data/local/ark-profile/100/{bundleName}/modules.ap {apPath} - ``` + - 通过命令行开启设备ap文件开关。 + ```shell + hdc shell param set ark.profile true + ``` + - 将应用按步骤1中release模式打包出hap并安装到设备上,在需要优化的场景进行操作,记录高频操作后,通过命令行导出ap文件。 + ```shell + hdc file recv /data/local/ark-profile/100/{bundleName}/modules.ap {apPath} + ``` 4. 将步骤3中获取到的ap文件,放入步骤2中指定的apPath路径。 5. 按照步骤1中的release编译模式进行编译,并安装到设备,等待设备端侧AOT编译优化完成后,应用运行性能即可得到相应的提升。 diff --git a/code/Solutions/InputMethod/KikaInput/README_zh.md b/code/Solutions/InputMethod/KikaInput/README_zh.md index 2bfb43fd1cf569529bffee993f7697fb76380828..9637d1ae315a2e10206ad452c029e167a69b1ed9 100644 --- a/code/Solutions/InputMethod/KikaInput/README_zh.md +++ b/code/Solutions/InputMethod/KikaInput/README_zh.md @@ -103,9 +103,9 @@ kikainput是一个轻量级的输入法应用,支持在运行OpenHarmony OS的 2.本示例为Stage模型,从API version 9开始支持。 -3. 本示例已适配API version 10版本SDK,SDK版本号(API Version 10 Release),镜像版本号(4.0Release); +3. 本示例已适配API version 12版本SDK,SDK版本号(API Version 12 Release),镜像版本号(5.0Release); -4. 本示例需要使用DevEco Studio 版本号(4.0Release)及以上版本才可编译运行。 +4. 本示例需要使用DevEco Studio 版本号(5.0Release)及以上版本才可编译运行。 5.如果安装本示例报错为error:install sign info inconsistent,则有可能本应用被设置为系统预置应用,已安装在系统中,此时需使用命令进行替换安装,并在替换安装后对设备进行重启操作,具体命令如下: diff --git a/code/Solutions/InputMethod/KikaInput/build-profile.json5 b/code/Solutions/InputMethod/KikaInput/build-profile.json5 index 047461033e01e326209d2b92daee651869859dba..8ee6a544c8e7e072d5b21fede441619209eb803a 100644 --- a/code/Solutions/InputMethod/KikaInput/build-profile.json5 +++ b/code/Solutions/InputMethod/KikaInput/build-profile.json5 @@ -19,8 +19,8 @@ { "name": "default", "signingConfig": "default", - "compileSdkVersion": 10, - "compatibleSdkVersion": 10, + "compileSdkVersion": 12, + "compatibleSdkVersion": 12, "runtimeOS": "OpenHarmony" } ], diff --git a/code/Solutions/InputMethod/KikaInput/hvigor/hvigor-config.json5 b/code/Solutions/InputMethod/KikaInput/hvigor/hvigor-config.json5 index 842ef41e83bfe30fceebc072cf1c0f4e2b1f6510..a717ac60b20818a38904036adc4e115a85105bce 100644 --- a/code/Solutions/InputMethod/KikaInput/hvigor/hvigor-config.json5 +++ b/code/Solutions/InputMethod/KikaInput/hvigor/hvigor-config.json5 @@ -1,6 +1,5 @@ { - "hvigorVersion":"3.0.2", - "dependencies":{ - "@ohos/hvigor-ohos-plugin":"3.0.2" - } + "modelVersion": "5.0.1", + "dependencies": { + } } \ No newline at end of file diff --git a/code/Solutions/InputMethod/KikaInput/oh-package.json5 b/code/Solutions/InputMethod/KikaInput/oh-package.json5 index 6ef24da728ae5dfa935d38aabe4e76928a8dc7de..1320ab4ee88a03d513636876822658ff077688a5 100644 --- a/code/Solutions/InputMethod/KikaInput/oh-package.json5 +++ b/code/Solutions/InputMethod/KikaInput/oh-package.json5 @@ -1,4 +1,5 @@ { + "modelVersion": "5.0.1", "license": "", "devDependencies": { "@ohos/hypium": "1.0.6" diff --git a/code/Solutions/Shopping/OrangeShopping/README_zh.md b/code/Solutions/Shopping/OrangeShopping/README_zh.md index 246f15068375ee90268087918bde91898cca3a10..368f78a39fdf1c4de310a708b76864c27f1081ac 100644 --- a/code/Solutions/Shopping/OrangeShopping/README_zh.md +++ b/code/Solutions/Shopping/OrangeShopping/README_zh.md @@ -5,21 +5,21 @@ 本示例展示在进场时加载进场动画,整体使用**Tabs**容器设计应用框架,通过**TabContent**组件设置分页面,在子页面中绘制界面。通过Navigation完成页面之间的切换。在详情页中通过 **Video**组件加载视频资源,使用**CustomDialogController**弹窗选择位置信息,点击首页及购物车返回主页面。 -本示例使用[Tabs容器](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-tabs.md) -实现通过页签进行内容视图切换。使用[Navigation](https://gitee.com/openharmony/docs/blob/OpenHarmony-4.0-Beta2/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-navigation.md#navigation)实现页面之间的切换。使用[自定义弹窗](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md) -设置位置信息。使用[Swiper](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md) -组件实现页面展示图轮播。使用[Grid](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md) +本示例使用[Tabs容器](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-tabs.md) +实现通过页签进行内容视图切换。使用[Navigation](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-navigation.md)实现页面之间的切换。使用[自定义弹窗](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-methods-custom-dialog-box.md) +设置位置信息。使用[Swiper](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-swiper.md) +组件实现页面展示图轮播。使用[Grid](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-grid.md) 容器组件设置展示的商品信息。 -本示例用到了延迟任务回调能力接口[@ohos.WorkSchedulerExtensionAbility](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md) 。 +本示例用到了延迟任务回调能力接口[@ohos.WorkSchedulerExtensionAbility](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-backgroundtasks-kit/js-apis-WorkSchedulerExtensionAbility.md)。 -通知管理的能力接口[@ohos.notification](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-notification.md) 。 +通知管理的能力接口[@ohos.notification](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-notification-kit/js-apis-notification.md)。 -HTTP数据请求能力接口[@ohos.net.http]( https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-http.md) 。 +HTTP数据请求能力接口[@ohos.net.http](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-network-kit/js-apis-http.md)。 -媒体查询接口[@system.mediaquery](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-system-mediaquery.md) 。 +媒体查询接口[@system.mediaquery](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-arkui/js-apis-system-mediaquery.md)。 -管理窗口能力接口[@ohos.window](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-window.md) 。 +管理窗口能力接口[@ohos.window](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-arkui/js-apis-window.md)。 ### 效果预览 @@ -86,7 +86,7 @@ OrangeShopping ### 相关概念 -动效能力:动画应该尽可能减少冗余刷新,合理地使用[动效](https://docs.openharmony.cn/pages/v4.0/zh-cn/application-dev/performance/animation_practice.md/)开发效率更高,可以获得更好的性能。 +动效能力:动画应该尽可能减少冗余刷新,合理地使用[动画动效](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/ui/ui-js-animate-dynamic-effects.md)开发效率更高,可以获得更好的性能。 ### 具体实现 Navigation相关的能力:NavPathStack路由转场,跨包引用Hsp,动态加载等能力[详见Navigation开发示例文章](docs/Navigation_zh.md) 。 @@ -100,81 +100,81 @@ Navigation相关的能力:NavPathStack路由转场,跨包引用Hsp,动态加 ohos.permission.CAMERA" **3.Navigation的使用:** - [Navigation](https://gitee.com/openharmony/docs/blob/OpenHarmony-4.0-Beta2/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-navigation.md#navigation)组件主要包含主页和内容页。主页由标题栏、内容区和工具栏组成,其中内容区默认首页显示导航内容(Navigation的子组件) - 或非首页显示(NavDestination的子组件),首页和非首页通过路由进行切换。Navigation的路由切换的方式有两种,在API Version 9上,首页导航内容需要配合[NavRouter](https://gitee.com/openharmony/docs/blob/OpenHarmony-4.0-Beta2/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-navrouter.md)组件实现页面路由, - 从API Version 10开始,首页推荐使用[NavPathStack](https://gitee.com/openharmony/docs/blob/OpenHarmony-4.0-Beta2/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-navigation.md#navpathstack10)配合[NavDestination](https://gitee.com/openharmony/docs/blob/OpenHarmony-4.0-Beta2/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-navdestination.md)属性进行页面路由。本次示例主要介绍NavPathStack的使用,如下步骤所示: - * NavPathStack有两种路由切换方法,一种是pushPath,如主页---->设置页面,通过使用this.pageStack.pushPath({ name: 'SetPage' })进行跳转,源码参考[TitleBar.ets](feature/navigationHome/src/main/ets/components/home/TitleBar.ets), - 另外一种是pushPathByName,如主页---->详情页面,通过使用this.pageStack.pushPathByName('DetailPage', item)进行跳转,其中item为需要传递的参数,源码参考[GoodsList.ets](feature/navigationHome/src/main/ets/components/good/GoodsList.ets) - - * NavPathStack支持pop、move、clear方法的使用;pop方法的作用是弹出路由栈栈顶元素,如首页进入商品详情页面,在详情页面使用this.pageStack.pop()方法返回到首页,clear方法的作用是清除栈中所有页面, - 如首页跳转到详情页面,详情页面再进入直播页面,在直播页面通过使用this.pageStack.clear()直接返回到首页。除此之外,还有popTo(回退路由栈到第一个名为name的NavDestination页面)、 - popToIndex(回退路由栈到index指定的NavDestination页面)、moveToTop(将第一个名为name的NavDestination页面移到栈顶)、moveIndexToTop(将index指定的NavDestination页面移到栈顶)方法, - 由于本示例暂时没有合适的按钮去承载这些功能,所以本示例未体现。 - - * 路由栈信息,如下所示,源码参考[DetailPage.ets](feature/detailPageHsp/src/main/ets/main/DetailPage.ets); - ``` - 获取栈中所有NavDestination页面的名称:this.pageInfos.getAllPathName() - 获取index指定的NavDestination页面的参数信息:this.pageInfos.getParamByIndex(1) - 获取全部名为name的NavDestination页面的参数信息:this.pageInfos.getParamByName('pageTwo') - 获取全部名为name的NavDestination页面的位置索引:this.pageInfos.getIndexByName('pageOne') - 获取栈大小:this.pageInfos.size() - ``` -**4.动态加载的使用:** - - * 定义需要被动态加载的组件DetailPage,本示例中组件加载使用搭配Navigation实现。源码参考[DetailPage.ets](feature/detailPageHsp/src/main/ets/main/DetailPage.ets); - * 定义一个DynamicLoader动态回调类作为容器,用来注册和调用动态加载函数。源码参考[DynamicLoader.ets](feature/navigationHome/src/main/ets/common/DynamicLoader.ets); - * 将DetailPage组件用DetailPageLoader函数封装,当DetailPageLoader被调用时,会渲染DetailPage页面。源码参考[DetailPageLoader.ets](entry/src/main/ets/pages/DetailPageLoader.ets); - * 在主页实现动态加载DetailPage的步骤如下: - 由于navDestination无法直接动态import组件(import是函数,组件中无法引用函数),此处采用声明@BuilderParam detailPageLoader函数,在点击时初始化此函数,此时navDestination中可以调用this.detailPageLoader()从而加载组件DetailPage。 - - a)主页Home中定义组件加载函数@BuilderParam detailPageLoader: () => void,用来承接await import异步导入detailPageLoader的结果。源码参考[Home.ets](entry/src/main/ets/pages/Home.ets), - ``` - @BuilderParam detailPageLoader: () => void - ``` - b)注册异步函数,点击时为detailPageLoader初始化,当满足key为DetailPage时,此时异步的加载DetailPageLoader,渲染DetailPage源码参考[Home.ets](entry/src/main/ets/pages/Home.ets), +[Navigation](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-navigation.md)组件主要包含主页和内容页。主页由标题栏、内容区和工具栏组成,其中内容区默认首页显示导航内容(Navigation的子组件) +或非首页显示(NavDestination的子组件),首页和非首页通过路由进行切换。Navigation的路由切换的方式有两种,在API Version 9上,首页导航内容需要配合[NavRouter](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-navrouter.md)组件实现页面路由, +从API Version 10开始,首页推荐使用[NavPathStack](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-navigation.md#navpathstack10)配合[NavDestination](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-navigation.md)属性进行页面路由。本次示例主要介绍NavPathStack的使用,如下步骤所示: +* NavPathStack有两种路由切换方法,一种是pushPath,如主页---->设置页面,通过使用this.pageStack.pushPath({ name: 'SetPage' })进行跳转,源码参考[TitleBar.ets](feature/navigationHome/src/main/ets/components/home/TitleBar.ets), + 另外一种是pushPathByName,如主页---->详情页面,通过使用this.pageStack.pushPathByName('DetailPage', item)进行跳转,其中item为需要传递的参数,源码参考[GoodsList.ets](feature/navigationHome/src/main/ets/components/good/GoodsList.ets) + +* NavPathStack支持pop、move、clear方法的使用;pop方法的作用是弹出路由栈栈顶元素,如首页进入商品详情页面,在详情页面使用this.pageStack.pop()方法返回到首页,clear方法的作用是清除栈中所有页面, + 如首页跳转到详情页面,详情页面再进入直播页面,在直播页面通过使用this.pageStack.clear()直接返回到首页。除此之外,还有popTo(回退路由栈到第一个名为name的NavDestination页面)、 + popToIndex(回退路由栈到index指定的NavDestination页面)、moveToTop(将第一个名为name的NavDestination页面移到栈顶)、moveIndexToTop(将index指定的NavDestination页面移到栈顶)方法, + 由于本示例暂时没有合适的按钮去承载这些功能,所以本示例未体现。 + +* 路由栈信息,如下所示,源码参考[DetailPage.ets](feature/detailPageHsp/src/main/ets/main/DetailPage.ets); ``` - DynamicLoader.getInstance().register( - async (key: string) => { - if (key === "DetailPage") { - let obj = await import("./DetailPageLoader") - this.detailPageLoader = obj.DetailPageLoader; - } - } - ``` - c) 定义NavDestination中动态加载函数,当存在跳转行为时,会调用此函数,源码参考[Home.ets](entry/src/main/ets/pages/Home.ets); - ``` - PageMap(name: string, param: NavPathStack) { - if (name === 'DetailPage') { - this.detailPageLoader(); - }) - ``` - d)按钮触发点击函数,调用detailPageLoader,此时真正的初始化@BuilderParam detailPageLoader,并通过Navigation中PageMap动态加载组件DetailPage。,源码参考[GoodsList.ets](feature/navigationHome/src/main/ets/components/good/GoodsList.ets), - ``` - Column() // 首页goodsList组件 - .onClick(() => { - // 动态加载组件 - DynamicLoader.getInstance().fire('DetailPage').then(()=>{ - this.active = true; - this.pageStack.pushPathByName('DetailPage', item); - }) - }) + 获取栈中所有NavDestination页面的名称:this.pageInfos.getAllPathName() + 获取index指定的NavDestination页面的参数信息:this.pageInfos.getParamByIndex(1) + 获取全部名为name的NavDestination页面的参数信息:this.pageInfos.getParamByName('pageTwo') + 获取全部名为name的NavDestination页面的位置索引:this.pageInfos.getIndexByName('pageOne') + 获取栈大小:this.pageInfos.size() ``` +**4.动态加载的使用:** + +* 定义需要被动态加载的组件DetailPage,本示例中组件加载使用搭配Navigation实现。源码参考[DetailPage.ets](feature/detailPageHsp/src/main/ets/main/DetailPage.ets); +* 定义一个DynamicLoader动态回调类作为容器,用来注册和调用动态加载函数。源码参考[DynamicLoader.ets](feature/navigationHome/src/main/ets/common/DynamicLoader.ets); +* 将DetailPage组件用DetailPageLoader函数封装,当DetailPageLoader被调用时,会渲染DetailPage页面。源码参考[DetailPageLoader.ets](entry/src/main/ets/pages/DetailPageLoader.ets); +* 在主页实现动态加载DetailPage的步骤如下: + 由于navDestination无法直接动态import组件(import是函数,组件中无法引用函数),此处采用声明@BuilderParam detailPageLoader函数,在点击时初始化此函数,此时navDestination中可以调用this.detailPageLoader()从而加载组件DetailPage。 + + a)主页Home中定义组件加载函数@BuilderParam detailPageLoader: () => void,用来承接await import异步导入detailPageLoader的结果。源码参考[Home.ets](entry/src/main/ets/pages/Home.ets), + ``` + @BuilderParam detailPageLoader: () => void + ``` + b)注册异步函数,点击时为detailPageLoader初始化,当满足key为DetailPage时,此时异步的加载DetailPageLoader,渲染DetailPage源码参考[Home.ets](entry/src/main/ets/pages/Home.ets), + ``` + DynamicLoader.getInstance().register( + async (key: string) => { + if (key === "DetailPage") { + let obj = await import("./DetailPageLoader") + this.detailPageLoader = obj.DetailPageLoader; + } + } + ``` + c) 定义NavDestination中动态加载函数,当存在跳转行为时,会调用此函数,源码参考[Home.ets](entry/src/main/ets/pages/Home.ets); + ``` + PageMap(name: string, param: NavPathStack) { + if (name === 'DetailPage') { + this.detailPageLoader(); + }) + ``` + d)按钮触发点击函数,调用detailPageLoader,此时真正的初始化@BuilderParam detailPageLoader,并通过Navigation中PageMap动态加载组件DetailPage。,源码参考[GoodsList.ets](feature/navigationHome/src/main/ets/components/good/GoodsList.ets), + ``` + Column() // 首页goodsList组件 + .onClick(() => { + // 动态加载组件 + DynamicLoader.getInstance().fire('DetailPage').then(()=>{ + this.active = true; + this.pageStack.pushPathByName('DetailPage', item); + }) + }) + ``` **5.hsp包的创建与使用:** - 本示例以创建detailPageHsp的hsp包为例,[Hsp包介绍及详细操作步骤](https://docs.openharmony.cn/pages/v4.0/zh-cn/application-dev/quick-start/in-app-hsp.md/) - * 在根目录右键新创建module为Shared Library类型的hsp模块,并将模块命名为detailPageHsp并拖拽至feature文件夹下做包的统一管理; - * 定义hsp出口:在创建后的hsp包内编写业务代码,并在index.ets中export组件。[源码参考](feature/detailPageHsp/Index.ets); - * 引用方hap如何使用hsp:通过在oh-package.json5文件中加入定义的hsp依赖。[源码参考](entry/oh-package.json5); +本示例以创建detailPageHsp的hsp包为例,[Hsp包介绍](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/quick-start/in-app-hsp.md) +* 在根目录右键新创建module为Shared Library类型的hsp模块,并将模块命名为detailPageHsp并拖拽至feature文件夹下做包的统一管理; +* 定义hsp出口:在创建后的hsp包内编写业务代码,并在index.ets中export组件。[源码参考](feature/detailPageHsp/Index.ets); +* 引用方hap如何使用hsp:通过在oh-package.json5文件中加入定义的hsp依赖。[源码参考](entry/oh-package.json5); ``` "dependencies": { "@ohos/details-page-hsp": "file:../feature/detailPageHsp", } ``` - * hap中使用:在组件中引入依赖。[源码参考](entry/src/main/ets/pages/Detail.ets) +* hap中使用:在组件中引入依赖。[源码参考](entry/src/main/ets/pages/Detail.ets) ``` import { DetailPage } from '@ohos/details-page-hsp'; ``` - * 编译时需选中detailPageHsp模块,在ide的工具栏中选择build-Make Module 'detailPageHsp'。 - * 运行时,需要在运行模块处配置edit Configuration并勾选Deploy Multi Hap Packages进行混合编译,即可运行。[详细操作步骤](https://docs.openharmony.cn/pages/v4.0/zh-cn/application-dev/quick-start/in-app-hsp.md/) +* 编译时需选中detailPageHsp模块,在ide的工具栏中选择build-Make Module 'detailPageHsp'。 +* 运行时,需要在运行模块处配置edit Configuration并勾选Deploy Multi Hap Packages进行混合编译,即可运行。[详细操作步骤](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/quick-start/in-app-hsp.md) 6.多屏监听:在首页加载时会通过mediaquery.matchMediaSync()监听当前屏幕尺寸curBp=[sm代表小屏,md代表中屏,lg代表大屏] ,并将当前值存储到Appstorage里,通过AppStorage.SetOrCreate('curBp', this.curBp)。 @@ -187,23 +187,23 @@ shoppingCartData)。[源码参考](feature/emitter/src/main/ets/components/featu ### 相关权限 -允许使用Internet网络: [ohos.permission.INTERNET](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissioninternet) +允许使用Internet网络: [ohos.permission.INTERNET](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissioninternet) -允许应用控制马达振动:[ohos.permission.VIBRATE](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionvibrate) +允许应用控制马达振动:[ohos.permission.VIBRATE](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionvibrate) -允许应用使用相机拍摄照片和录制视频:[ohos.permission.CAMERA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissioncamera) +允许应用使用相机拍摄照片和录制视频:[ohos.permission.CAMERA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissioncamera) -允许应用获取设备位置信息:[ohos.permission.LOCATION](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionlocation) +允许应用获取设备位置信息:[ohos.permission.LOCATION](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionlocation) -允许应用在后台运行时获取设备位置信息:[ohos.permission.LOCATION_IN_BACKGROUND](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionlocation_in_background) +允许应用在后台运行时获取设备位置信息:[ohos.permission.LOCATION_IN_BACKGROUND](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionlocation_in_background) -允许应用截取屏幕图像 :[ohos.permission.CAPTURE_SCREEN ](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissioncapture_screen) +允许应用截取屏幕图像 :[ohos.permission.CAPTURE_SCREEN ](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissioncapture_screen) -允许应用读取用户外部存储中的媒体文件信息:[ohos.permission.READ_MEDIA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionread_media) +允许应用访问用户媒体文件中的地理位置信息 :[ohos.permission.MEDIA_LOCATION](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionmedia_location) -允许应用访问用户媒体文件中的地理位置信息 :[ohos.permission.MEDIA_LOCATION](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionmedia_location) +允许读取用户公共目录的图片或视频文件 : [ohos.permission.READ_IMAGEVIDEO](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionread_imagevideo) -允许应用读写用户外部存储中的媒体文件信息 :[ohos.permission.WRITE_MEDIA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionwrite_media) +允许修改用户公共目录的图片或视频文件 : [ohos.permission.WRITE_IMAGEVIDEO](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionwrite_imagevideo) ### 依赖 @@ -216,7 +216,7 @@ shoppingCartData)。[源码参考](feature/emitter/src/main/ets/components/featu [媒体库视频](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/Media/VideoShow) 本示例的详情页中的视频功能依赖此示例。 -[分享](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/ApplicationModels/CustomShare) +[分享](https://gitee.com/openharmony/applications_app_samples/tree/master/code/SystemFeature/ApplicationModels/CustomShare) 本示例的详情页中的分享功能依赖此示例。 [事件通知](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/Notification/CustomNotification) @@ -229,21 +229,21 @@ shoppingCartData)。[源码参考](feature/emitter/src/main/ets/components/featu 1.本示例仅支持标准系统上运行,支持设备:RK3568。 -2.本示例已适配API10版本SDK,SDK版本号(API Version 10 Release),镜像版本号(4.0 Release)。 +2.本示例已适配API11版本SDK,SDK版本号(API Version 12 Release),镜像版本号(5.0.0 Release)。 -3.本示例需要使用DevEco Studio 版本号(4.0 Release)及以上版本才可编译运行。 +3.本示例需要使用DevEco Studio 版本号(4.1 Release)及以上版本才可编译运行。 4.本示例需要使用系统权限的接口。使用Full SDK时需要手动从镜像站点获取,并在DevEco -Studio中替换,具体操作可参考[替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/)。 +Studio中替换,具体操作可参考[替换指南](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/faqs/full-sdk-switch-guide.md)。 5.本示例需联网运行。 6.弹窗升级需配置服务器后触发。 7.本示例所配置的权限ohos.permission.CAPTURE_SCREEN为system_core级别( -相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md) +相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md) 查看),需要手动配置对应级别的权限签名( -具体操作可查看[自动化签名方案](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/hapsigntool-overview.md/)。 +具体操作可查看[自动化签名方案](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V3/ohos-auto-configuring-signature-information-0000001271659465-V3)。 ### 下载 diff --git a/code/Solutions/Shopping/OrangeShopping/build-profile.json5 b/code/Solutions/Shopping/OrangeShopping/build-profile.json5 index 45b02b25b3e5663c489f62ec667f2bbfa946fb50..9b1fefa39d53e3bf7d3fb7eb75e34b5f369d3414 100644 --- a/code/Solutions/Shopping/OrangeShopping/build-profile.json5 +++ b/code/Solutions/Shopping/OrangeShopping/build-profile.json5 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -19,14 +19,12 @@ { "name": "default", "signingConfig": "default", - "compileSdkVersion": 10, - "compatibleSdkVersion": 10, - "targetSdkVersion": 10, + "compileSdkVersion": 12, + "compatibleSdkVersion": 12, "runtimeOS": "OpenHarmony" } ], - "signingConfigs": [ - ] + "signingConfigs": [] }, "modules": [ { diff --git a/code/Solutions/Shopping/OrangeShopping/docs/Navigation_zh.md b/code/Solutions/Shopping/OrangeShopping/docs/Navigation_zh.md index 713d95d2f0fb2ff5fe877696700270e60be98a35..f41e339c7cee2abe4526a8f3553d4e040c84557a 100644 --- a/code/Solutions/Shopping/OrangeShopping/docs/Navigation_zh.md +++ b/code/Solutions/Shopping/OrangeShopping/docs/Navigation_zh.md @@ -33,7 +33,7 @@ Navigation的路由切换的方式有两种,本次示例主要介绍NavPathSta | Navigation | 模块内页面切换 | 通过组件级路由统一路由管理 | 向右折叠转场效果 | ## 使用NavPathStack路由转场 -NavPathStack是Navigation路由栈,通过对栈内元素的操作,完成页面的路由转场。详细API如下表, [详细API说明文档](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-navigation.md): +NavPathStack是Navigation路由栈,通过对栈内元素的操作,完成页面的路由转场。详细API如下表, [详细API说明文档](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-navigation.md): | API | 描述 | | --------------- | ----------------------------------------------------------- | diff --git a/code/Solutions/Shopping/OrangeShopping/entry/src/main/ets/MainAbility/MainAbility.ets b/code/Solutions/Shopping/OrangeShopping/entry/src/main/ets/MainAbility/MainAbility.ets index 1c2efc0ae44a660cb11a680fa891ff6a3847735d..00a364e1c0af33d721f88b75a65efe33ba0438c3 100644 --- a/code/Solutions/Shopping/OrangeShopping/entry/src/main/ets/MainAbility/MainAbility.ets +++ b/code/Solutions/Shopping/OrangeShopping/entry/src/main/ets/MainAbility/MainAbility.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -29,8 +29,8 @@ const EVENT: string = 'getAbilityData'; const PERMISSIONS: Array = [ 'ohos.permission.CAMERA', 'ohos.permission.MICROPHONE', - 'ohos.permission.READ_MEDIA', - 'ohos.permission.WRITE_MEDIA', + 'ohos.permission.READ_IMAGEVIDEO', + 'ohos.permission.WRITE_IMAGEVIDEO', 'ohos.permission.MEDIA_LOCATION', 'ohos.permission.INTERNET' ]; diff --git a/code/Solutions/Shopping/OrangeShopping/entry/src/main/ets/WorkAbility/WorkAbility.ets b/code/Solutions/Shopping/OrangeShopping/entry/src/main/ets/WorkAbility/WorkAbility.ets index f97c46be697f6990d9f5a9ecc962e143e5d1e54b..3ff73cc65ad3c97431a25e2507799a2c09d7743a 100644 --- a/code/Solutions/Shopping/OrangeShopping/entry/src/main/ets/WorkAbility/WorkAbility.ets +++ b/code/Solutions/Shopping/OrangeShopping/entry/src/main/ets/WorkAbility/WorkAbility.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -56,9 +56,9 @@ export default class WorkAbility extends WorkSchedulerExtensionAbility { ]; logger.info(TAG, `publishNotification actionButtons= ${JSON.stringify(actionButtons)}`); try { - let notificationContent = notificationContentUtil.initBasicNotificationContent(basicContent); + let notificationContent = notificationContentUtil.initBasicNotificationContent(basicContent) as notification.NotificationContent; logger.info(TAG, `publishNotification notificationContent= ${JSON.stringify(notificationContent)}`); - let notificationRequest = notificationRequestUtil.initButtonNotificationRequest(notificationContent, actionButtons); + let notificationRequest = notificationRequestUtil.initButtonNotificationRequest(notificationContent, actionButtons) as notification.NotificationRequest; logger.info(TAG, `publishNotification notificationRequest= ${JSON.stringify(notificationRequest)}`); notificationUtil.publishNotification(notificationRequest, NOTIFICATION_ID); } catch (error) { diff --git a/code/Solutions/Shopping/OrangeShopping/entry/src/main/module.json5 b/code/Solutions/Shopping/OrangeShopping/entry/src/main/module.json5 index 798c657aa1c7ff608522f522a2f42f4bb2448090..cabe48e5105af8959904757481ff47c35b5f06a8 100644 --- a/code/Solutions/Shopping/OrangeShopping/entry/src/main/module.json5 +++ b/code/Solutions/Shopping/OrangeShopping/entry/src/main/module.json5 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 Huawei Device Co., Ltd. +* Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -17,7 +17,7 @@ "module": { "name": "entry", "type": "entry", - "srcEntrance": "./ets/Application/MyAbilityStage.ets", + "srcEntry": "./ets/Application/MyAbilityStage.ets", "description": "$string:entry_descc", "mainElement": "MainAbility", "deviceTypes": [ @@ -31,7 +31,7 @@ "abilities": [ { "name": "MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ets", + "srcEntry": "./ets/MainAbility/MainAbility.ets", "description": "$string:MainAbility_descc", "icon": "$media:icon", "label": "$string:MainAbility_name", @@ -54,7 +54,7 @@ "extensionAbilities": [ { "name": "WorkAbility", - "srcEntrance": "./ets/WorkAbility/WorkAbility.ets", + "srcEntry": "./ets/WorkAbility/WorkAbility.ets", "label": "$string:WorkSchedulerExtensionAbility_label", "description": "$string:WorkSchedulerExtensionAbility_desc", "type": "workScheduler", @@ -102,7 +102,7 @@ "name": "ohos.permission.CAPTURE_SCREEN" }, { - "name": "ohos.permission.READ_MEDIA", + "name": "ohos.permission.READ_IMAGEVIDEO", "reason": "$string:read_permission", "usedScene": { "abilities": [ @@ -112,7 +112,7 @@ } }, { - "name": "ohos.permission.WRITE_MEDIA", + "name": "ohos.permission.WRITE_IMAGEVIDEO", "reason": "$string:write_permission", "usedScene": { "abilities": [ diff --git a/code/Solutions/Shopping/OrangeShopping/entry/src/ohosTest/module.json5 b/code/Solutions/Shopping/OrangeShopping/entry/src/ohosTest/module.json5 index b71c5791012c0440e65611dd3d41c8018b0ce1ba..2d90714e9a4084ecfeedcb74a58d0ecdfc93218e 100644 --- a/code/Solutions/Shopping/OrangeShopping/entry/src/ohosTest/module.json5 +++ b/code/Solutions/Shopping/OrangeShopping/entry/src/ohosTest/module.json5 @@ -35,7 +35,7 @@ "abilities": [ { "name": "TestAbility", - "srcEntrance": "./ets/testability/TestAbility.ets", + "srcEntry": "./ets/testability/TestAbility.ets", "description": "$string:TestAbility_desc", "icon": "$media:icon", "label": "$string:TestAbility_label", diff --git a/code/Solutions/Shopping/OrangeShopping/feature/emitter/src/main/ets/components/feature/EmitterClass.ets b/code/Solutions/Shopping/OrangeShopping/feature/emitter/src/main/ets/components/feature/EmitterClass.ets index d63012e50846304e27bf76e6b29df6653b6755ac..99a67bcb19b8952e8eb3a22412dd441c44416f84 100644 --- a/code/Solutions/Shopping/OrangeShopping/feature/emitter/src/main/ets/components/feature/EmitterClass.ets +++ b/code/Solutions/Shopping/OrangeShopping/feature/emitter/src/main/ets/components/feature/EmitterClass.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -58,7 +58,7 @@ export class EmitterClass { let addGoodDataId: EventsId = new EventsId(EmitterConst.ADD_EVENT_ID); // 以持久化方式订阅购物车添加事件并接收事件回调 emitter.off(EmitterConst.ADD_EVENT_ID); - emitter.on(addGoodDataId, (eventData: EventsData) => { + emitter.on(addGoodDataId, (eventData) => { callback(eventData); }); } diff --git a/code/Solutions/Shopping/OrangeShopping/hvigor/hvigor-config.json5 b/code/Solutions/Shopping/OrangeShopping/hvigor/hvigor-config.json5 index 122677b194bc767301ef00a87a4b93c45562fe31..a2eb20c67c35c8b1b6d7f34b63dfd44d5d09505e 100644 --- a/code/Solutions/Shopping/OrangeShopping/hvigor/hvigor-config.json5 +++ b/code/Solutions/Shopping/OrangeShopping/hvigor/hvigor-config.json5 @@ -1,6 +1,21 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + { - "hvigorVersion": "3.0.9", + "hvigorVersion": "4.1.2", "dependencies": { - "@ohos/hvigor-ohos-plugin": "3.0.9" + "@ohos/hvigor-ohos-plugin": "4.1.2" } } \ No newline at end of file diff --git a/code/Solutions/Shopping/OrangeShopping/libs/ohos-qr-code-scan-1.0.2.har b/code/Solutions/Shopping/OrangeShopping/libs/ohos-qr-code-scan-1.0.2.har index 347244951bc1ba54c93ee0f1d3f3bc60bfafd355..edfbc9d565b1184c5961c95977e00e36506e40ba 100644 --- a/code/Solutions/Shopping/OrangeShopping/libs/ohos-qr-code-scan-1.0.2.har +++ b/code/Solutions/Shopping/OrangeShopping/libs/ohos-qr-code-scan-1.0.2.har @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2f8eeda4ce1bbc33756d5a861ef233e028b40a51ed694d01c3c90f2fc212c1f0 -size 32670 +oid sha256:db4dd6b35e61c54ff450256693ea6327ad0a3b03af41f1919d0b53a1b2fdc574 +size 33873 diff --git a/code/Solutions/Shopping/OrangeShopping/libs/ohos-sharecomponent-1.0.2.har b/code/Solutions/Shopping/OrangeShopping/libs/ohos-sharecomponent-1.0.2.har index cb6e8f5bdc41e78ec016741cb7c96634d755ef04..2085069f30038668ee1d042d0c259b5ed043a5f3 100644 --- a/code/Solutions/Shopping/OrangeShopping/libs/ohos-sharecomponent-1.0.2.har +++ b/code/Solutions/Shopping/OrangeShopping/libs/ohos-sharecomponent-1.0.2.har @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0e279a6d80bae4779d7e3d844beeb4974ef6fbf70f42df786094c9c0b5f9146d -size 169646 +oid sha256:19e439c2b44b4e68119023d605e4ec23b14495ff924a2af1518072c19c140623 +size 169891 diff --git a/code/Solutions/Social/GrapeSquare/README_zh.md b/code/Solutions/Social/GrapeSquare/README_zh.md index 667e3b208731df2b8411fcc757b59f96b1eb4742..9cfffa71fc5632db2b8a3ea55f4f56eb14d4443f 100644 --- a/code/Solutions/Social/GrapeSquare/README_zh.md +++ b/code/Solutions/Social/GrapeSquare/README_zh.md @@ -70,21 +70,21 @@ products/phone/entry/src/main/ets 然后通过helper.createAsset()方法得到媒体库图片的uri, resourceManager.getMediaContent()可以得到存放在Resources/base/media文件下的banner.png图片内容, 使用fs.open()和fs.write()方法将图片内容通过得到的uri写到媒体库中,最后通过fs.close()方法关闭文件 * 源码链接:[SaveControl.ets](feature/authorizedControl/src/main/ets/authorizedControl/SaveControl.ets) - * 接口参考:[@ohos.file.photoAccessHelper](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-photoAccessHelper.md),[@ohos.file.fs](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-file-fs.md#fsopen) - + * 接口参考:[@ohos.file.photoAccessHelper](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper.md),[@ohos.file.fs](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-fs.md) + * 文本的复制和粘贴 * 使用PasteButton控件获取剪贴板信息,在其点击回调onclick事件中调用systemPasteboard.setData()方法将文本复制到剪贴板中,然后通过systemPasteboard.getData()方法得到剪贴板内容 * 源码链接:[PasteButton.ets](feature/authorizedControl/src/main/ets/authorizedControl/PasteControl.ets) - * 接口参考:[@ohos.pasteboard](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-pasteboard.md#getdata9) + * 接口参考:[@ohos.pasteboard](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-pasteboard.md) * 位置信息的获取 - + * 使用LocationButton控件获取定位信息,在其点击回调onclick事件中调用geoLocationManager.getCurrentLocation()方法得到当前定位信息经纬度。 * 源码链接:[LocationButton.ets](feature/authorizedControl/src/main/ets/authorizedControl/LocationControl.ets) - * 接口参考:[@ohos.geoLocationManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-geoLocationManager.md#geolocationmanagergetcurrentlocation) + * 接口参考:[@ohos.geoLocationManager](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-location-kit/js-apis-geoLocationManager-sys.md) + - ### 相关权限 不涉及。 diff --git a/code/Solutions/Tools/ArkTSClock/README_zh.md b/code/Solutions/Tools/ArkTSClock/README_zh.md index 1a8c97acb98e49c2d53e5e0a4869a75c531ce6ed..d7013e14edf3d414fcc54cbc5babd6a4aa6e89fd 100644 --- a/code/Solutions/Tools/ArkTSClock/README_zh.md +++ b/code/Solutions/Tools/ArkTSClock/README_zh.md @@ -32,7 +32,7 @@ entry/src/main/ets/ * 本示例展示简单时钟的方法主要封装在Index中,源码参考:[Index.ets](entry/src/main/ets/pages/Index.ets) 。 * 设置表盘大小:通过Index中的display.getDefaultDisplay()方法来获取设备宽高计算表盘大小; * 获取当前时间:调用updateTime函数,执行new Date().getHours()、new Date().getMinutes()、new Date().getSeconds()获取当前时间。 - * 绘制表盘内容:通过[CanvasRenderingContext2D](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md) 来画表盘背景、时针、分针、秒针、圆心以及表盘下方文本; + * 绘制表盘内容:通过[CanvasRenderingContext2D](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-canvasrenderingcontext2d.md) 来画表盘背景、时针、分针、秒针、圆心以及表盘下方文本; * 启动时钟:添加setInterval定时器,每隔1s执行一次updateTime函数。 ### 相关权限 diff --git a/code/Solutions/Tools/FlipClock/README_zh.md b/code/Solutions/Tools/FlipClock/README_zh.md index f43d35ad9b60247e5444088340e6e5115bcd94d5..e67d93f21e8b51ab4be0d2ed4e1d5433a3756468 100644 --- a/code/Solutions/Tools/FlipClock/README_zh.md +++ b/code/Solutions/Tools/FlipClock/README_zh.md @@ -3,11 +3,11 @@ ### 介绍 本示例集中展示了时钟、闹钟、倒计时、设置屏幕亮度相关的场景, -1、使用[@ohos.reminderAgentManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-reminderAgentManager.md )完成闹钟的相关功能, -2、使用animateTo完成翻页时钟动画,使用[@ohos.runningLock](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-runninglock.md )完成屏幕常亮功能, -3、设置屏幕亮度,使用[@ohos.brightness](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-brightness.md )系统能力调节屏幕亮度, -4、后台消息提醒,使用[@ohos.notificationManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-notificationManager.md )系统能力做后台代理提醒。 -5、需要系统存储信息,使用用户首选项接口[@ohos.data.preferences](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md )。 +1、使用[@ohos.reminderAgentManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-backgroundtasks-kit/js-apis-reminderAgentManager.md )完成闹钟的相关功能, +2、使用animateTo完成翻页时钟动画,使用[@ohos.runningLock](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-runninglock.md )完成屏幕常亮功能, +3、设置屏幕亮度,使用[@ohos.brightness](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-brightness-sys.md )系统能力调节屏幕亮度, +4、后台消息提醒,使用[@ohos.notificationManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-notification-kit/js-apis-notificationManager.md )系统能力做后台代理提醒。 +5、需要系统存储信息,使用用户首选项接口[@ohos.data.preferences](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkdata/js-apis-data-preferences.md )。 ### 效果预览 @@ -57,46 +57,46 @@ entry/src/main/ets/ 2、使用tabs()标签,将四个组件封装。 * 组件逻辑实现 1、时钟: 通过aboutToAppear()中new date()获取当前时间,通过获取date的时、分、秒,10位数通过math.floor()取整,个位数通过对10取余,从而实现对时间格式化,使用box标签,对获取到的数据进行渲染。 - 2、闹钟: - * a) 使用自定义对话控制器CustomDialogController,定义时间选择器,使用data.preferences存储设置的闹钟,并使用reminderAgentManager将其添加到系统中。 - import data_preferences from '@ohos.data.preferences' - import reminderAgentManager from '@ohos.reminderAgentManager' + 2、闹钟: + * a) 使用自定义对话控制器CustomDialogController,定义时间选择器,使用data.preferences存储设置的闹钟,并使用reminderAgentManager将其添加到系统中。 + import data_preferences from '@ohos.data.preferences' + import reminderAgentManager from '@ohos.reminderAgentManager' * b) 页面从data.preferences获取添加的闹钟数据,通过Scroll()标签渲染,在标签row内,设置delete按钮,如果删除就调用以下函数取消系统时钟 - import reminderAgentManager from '@ohos.reminderAgentManager' - reminderAgentManager.cancelReminder - 3、倒计时 - * a) 使用aboutToAppear()初始化界面布局,通过this.listener.on('change', portraitFunc)添加监听, + import reminderAgentManager from '@ohos.reminderAgentManager' + reminderAgentManager.cancelReminder + 3、倒计时 + * a) 使用aboutToAppear()初始化界面布局,通过this.listener.on('change', portraitFunc)添加监听, * b) 点击开始按钮触发以下函数开始计时,并修改按钮的样式为暂停,并将running=true,触发canvas样式 - countInSec = pickerH * 3600 + pickerM * 60 + pickerS //总计时计算 - this.timer = setInterval(this.timerCountDown.bind(this), 1000) //时间计算 + countInSec = pickerH * 3600 + pickerM * 60 + pickerS //总计时计算 + this.timer = setInterval(this.timerCountDown.bind(this), 1000) //时间计算 * c) 点击暂停按钮,时间暂停,并将按钮样式修改为开始 - clearInterval(this.timer) - this.isRunning = true - this.isPausing = true - this.startImg = $r('app.media.start') + clearInterval(this.timer) + this.isRunning = true + this.isPausing = true + this.startImg = $r('app.media.start') * d) 点击reset计时重置,将所有数据初始化 - clearInterval(this.timer) - this.isRunning = false - this.isPausing = false - this.progressVal = 0 - this.rotates = 0 - passSec = 0 - this.hoursTime = 0 - this.minuteTime = 0 - this.secondTime = 0 - pickerH = 0 - pickerM = 0 - pickerS = 0 - this.startImg = $r('app.media.start') - this.resetImg = $r('app.media.resetccc') + clearInterval(this.timer) + this.isRunning = false + this.isPausing = false + this.progressVal = 0 + this.rotates = 0 + passSec = 0 + this.hoursTime = 0 + this.minuteTime = 0 + this.secondTime = 0 + pickerH = 0 + pickerM = 0 + pickerS = 0 + this.startImg = $r('app.media.start') + this.resetImg = $r('app.media.resetccc') ### 相关权限 -[ohos.permission.PUBLISH_AGENT_REMINDER](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionpublish_agent_reminder) +[ohos.permission.PUBLISH_AGENT_REMINDER](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionpublish_agent_reminder) -[ohos.permission.RUNNING_LOCK](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionrunning_lock) +[ohos.permission.RUNNING_LOCK](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionrunning_lock) -[ohos.permission.NOTIFICATION_CONTROLLER](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionnotification_controller) +[ohos.permission.NOTIFICATION_CONTROLLER](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionnotification_controller) ### 依赖 @@ -106,9 +106,9 @@ entry/src/main/ets/ 1.本示例仅支持在标准系统上运行。 -2.本示例需要使用DevEco Studio 3.1 Beta2 (Build Version: 3.1.0.400 , built on April 7, 2023)及以上版本才可编译运行。 +2.本示例需要使用DevEco Studio NEXT Developer Preview2 (Build Version: 4.1.3.700, built on March 19, 2024)版本才可编译运行。 -3.本示例已适配API version 9版本SDK,版本号:3.2.11.9; +3.本示例已适配API version 12版本SDK,版本号:5.0.0.70; ### 下载 diff --git a/code/SuperFeature/DistributedAppDev/DistributedJotNote/README_zh.md b/code/SuperFeature/DistributedAppDev/DistributedJotNote/README_zh.md index 455ea7d194b5d3b8d996a28afdedb8769470ac1c..335ea753407914aa9dc8fbf14e2d62451819b88f 100644 --- a/code/SuperFeature/DistributedAppDev/DistributedJotNote/README_zh.md +++ b/code/SuperFeature/DistributedAppDev/DistributedJotNote/README_zh.md @@ -4,13 +4,13 @@ 本示例主要展示了应用数据跨端迁移的能力,通过跨端迁移的能力实现了一个简单的随手记应用,可以响应系统迁移事件,控制应用的迁移能力、是否迁移页面栈以及迁移后是否退出源端等。同时实现了数据迁移以及ArkUI控件的迁移。本示例仅适配设备类型为phone。 -本示例使用了权限管理接口[@ohos.abilityAccessCtrl](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md)、分布式数据对象接口[@ohos.data.distributedDataObject](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-data-distributedobject.md)、基础文件操作接口[@ohos.file.fs](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-file-fs.md) 、相册管理模块接口[@ohos.file.photoAccessHelper](https://gitee.com/eileen-dxy/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-file-fs.md)、图片处理接口[@ohos.multimedia.image](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md)等接口,通过分布式数据对象以及分布式文件两种方式实现了图片数据的流转迁移。 +本示例使用了权限管理接口[@ohos.abilityAccessCtrl](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ability-kit/js-apis-abilityAccessCtrl.md)、分布式数据对象接口[@ohos.data.distributedDataObject](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkdata/js-apis-data-distributedobject.md)、基础文件操作接口[@ohos.file.fs](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-fs.md) 、相册管理模块接口[@ohos.file.photoAccessHelper](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper.md)、图片处理接口[@ohos.multimedia.image](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-image-kit/js-apis-image.md)等接口,通过分布式数据对象以及分布式文件两种方式实现了图片数据的流转迁移。 ### 效果预览 -|主页|迁移设置页|笔记页|图片墙页| -|--------------------------------|--------------------------------|--------------------------------|--------------------------------| -|![image](./screenshots/home.png)|![image](./screenshots/settings.png)|![image](./screenshots/notes.png)|![image](./screenshots/imgwall.png)| +| 主页 | 迁移设置页 | 笔记页 | 图片墙页 | +| -------------------------------- | ------------------------------------ | --------------------------------- | ----------------------------------- | +| ![image](./screenshots/home.png) | ![image](./screenshots/settings.png) | ![image](./screenshots/notes.png) | ![image](./screenshots/imgwall.png) | 使用说明 @@ -41,28 +41,28 @@ entry/src/main/ets/ | |---Notes.ets // 笔记页 | |---Settings.ets // 迁移设置页 | |---Todolist.ets // 待办事项页 -|---utils +|---utils | |---Logger.ts // 日志工具 -|---viewmodel +|---viewmodel | |---MainViewModel.ets // 获取轮播图数据 ``` ### 具体实现 -- 在端端迁移随手记应用里,迁移设置的功能在Setting.ets和entryability中的onContinue()实现,通过[UIAbilityContext](https://docs.openharmony.cn/pages/v4.0/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md/)的[setMissionContinueState](https://docs.openharmony.cn/pages/v4.0/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md/#uiabilitycontextsetmissioncontinuestate10)可以设置当前应用任务流转的状态,控制当前应用是否具有迁移能力。通过设置wantConstant.Params.SUPPORT_CONTINUE_PAGE_STACK_KEY和wantConstant.Params.SUPPORT_CONTINUE_SOURCE_EXIT_KEY的值可以控制当前应用是否迁移页面栈以及迁移后源端是否退出。 - -- 笔记页通过分布式数据对象和分布式文件在Notes.ets中实现大文件(100KB以上)数据的迁移。通过分布式文件的[跨设备文件访问](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/file-management/file-access-across-devices.md)实现了图片的迁移。源码参考:[Notes.ets](code/SuperFeature/DistributedAppDev/JotNote/entry/src/main/ets/pages/Notes.ets) +- 在端端迁移随手记应用里,迁移设置的功能在Setting.ets和entryability中的onContinue()实现,通过[UIAbilityContext](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ability-kit/js-apis-inner-application-uiAbilityContext.md)的[setMissionContinueState](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ability-kit/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextsetmissioncontinuestate10)可以设置当前应用任务流转的状态,控制当前应用是否具有迁移能力。通过设置wantConstant.Params.SUPPORT_CONTINUE_PAGE_STACK_KEY和wantConstant.Params.SUPPORT_CONTINUE_SOURCE_EXIT_KEY的值可以控制当前应用是否迁移页面栈以及迁移后源端是否退出。 +- 笔记页通过分布式数据对象和分布式文件在Notes.ets中实现大文件(100KB以上)数据的迁移。通过分布式文件的[跨设备文件访问](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/file-management/file-access-across-devices.md)实现了图片的迁移。源码参考:[Notes.ets](entry/src/main/ets/pages/Notes.ets) + * 获取分布式目录的文件路径filePath:context.distributedFilesDir+‘picture.jpg’,迁移图片文件使用.jpg来命名; - * 从图库中选择图片,使用选择器接口[@ohos.file.picker](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-file-picker.md)的PhotoViewPicker图库选择器对象选择一张图片并通过writeSrcToDistributedFile(this.uris)将选择的图片的uri写入分布式文件路径filePath,接口参考:[@ohos.file.fs](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-file-fs.md) - * 使用getImage()方法获取从图库中选择的图片资源PixelMap类型,首先使用photoAccessHelper.getPhotoAccessHelper(context)获取相册管理模块的实例,使用phAccessHelper.getAssets()获取图片资源,使用photoAsset.getThumbnail()获取所选的图片的PixelMap类型数据,接口参考:[ohos.file.photoAccessHelper](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-photoAccessHelper.md) 。 - * 在对端设备上迁移显示笔记页内容时,在aboutToAppear()钩子中调用readFromDistributedFile()读取分布式路径里存储的图片文件,首先以同步方法fs.accessSync(filePath)检查分布式路径下文件是否存在,通过image.createImageSource(filePath)传入的uri创建图片源实例imageSourceApi,通过imageSourceApi.createPixelMap()来创建PixelMap 并负责流转后展示,接口参考:[@ohos.multimedia.image](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md) 。 -- 通过restoreId()实现ArkUI控件保存对应信息的迁移,源码参考:[ImgWall.ets](code/SuperFeature/DistributedAppDev/JotNote/entry/src/main/ets/pages/ImgWall.ets) + * 从图库中选择图片,使用选择器接口[@ohos.file.picker](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-picker.md)的PhotoViewPicker图库选择器对象选择一张图片并通过writeSrcToDistributedFile(this.uris)将选择的图片的uri写入分布式文件路径filePath,接口参考:[@ohos.file.fs](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-fs.md) + * 使用getImage()方法获取从图库中选择的图片资源PixelMap类型,首先使用photoAccessHelper.getPhotoAccessHelper(context)获取相册管理模块的实例,使用phAccessHelper.getAssets()获取图片资源,使用photoAsset.getThumbnail()获取所选的图片的PixelMap类型数据,接口参考:[ohos.file.photoAccessHelper](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper.md) 。 + * 在对端设备上迁移显示笔记页内容时,在aboutToAppear()钩子中调用readFromDistributedFile()读取分布式路径里存储的图片文件,首先以同步方法fs.accessSync(filePath)检查分布式路径下文件是否存在,通过image.createImageSource(filePath)传入的uri创建图片源实例imageSourceApi,通过imageSourceApi.createPixelMap()来创建PixelMap 并负责流转后展示,接口参考:[@ohos.multimedia.image](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-image-kit/js-apis-image.md) 。 +- 通过restoreId()实现ArkUI控件保存对应信息的迁移,源码参考:[ImgWall.ets](entry/src/main/ets/pages/ImgWall.ets) ### 相关权限 -允许不同设备间的数据交换:[ohos.permission.DISTRIBUTED_DATASYNC](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissiondistributed_datasync) +允许不同设备间的数据交换:[ohos.permission.DISTRIBUTED_DATASYNC](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissiondistributed_datasync) -允许读取用户公共目录的图片或视频文件:[ ohos.permission.READ_IMAGEVIDEO](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionread_imagevideo) +允许读取用户公共目录的图片或视频文件:[ ohos.permission.READ_IMAGEVIDEO](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionread_imagevideo) ### 依赖 @@ -75,7 +75,7 @@ entry/src/main/ets/ 3. 本示例为stage模型,已适配API version 12版本SDK,SDK版本号(API Version 12 Release),镜像版本号(5.0.0.16)。 4. 本示例需要使用DevEco Studio 版本号(4.0Release)才可编译运行。 5. 本示例需要使用 ohos.permission.READ_IMAGEVIDEO权限级别为system_basic的系统接口。 -6. 本示例涉及系统接口,需要配置系统应用签名,可以参考[特殊权限配置方法](https://gitee.com/link?target=https%3A%2F%2Fdocs.openharmony.cn%2Fpages%2Fv3.2%2Fzh-cn%2Fapplication-dev%2Fsecurity%2Fhapsigntool-overview.md%2F) ,把配置文件中的“app-feature”字段信息改为“hos_system_app”。 +6. 本示例涉及系统接口,需要配置系统应用签名,可以参考[特殊权限配置方法](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/hapsigntool-overview.md) ,把配置文件中的“app-feature”字段信息改为“hos_system_app”。 ### 下载 @@ -86,4 +86,5 @@ git init echo code/SuperFeature/DistributedAppDev/DistributedJotNote/ > .git/info/sparse-checkout git remote add origin https://gitee.com/openharmony/applications_app_samples.git git pull origin master -``` \ No newline at end of file +``` + diff --git a/code/SuperFeature/DistributedAppDev/JsDistributedMusicPlayer/README_zh.md b/code/SuperFeature/DistributedAppDev/JsDistributedMusicPlayer/README_zh.md index b9e9b2894cce868aad741b120fcb9db8e2a8896f..283ee9950686b7857168d09ec30a7c78a0dbbbf8 100644 --- a/code/SuperFeature/DistributedAppDev/JsDistributedMusicPlayer/README_zh.md +++ b/code/SuperFeature/DistributedAppDev/JsDistributedMusicPlayer/README_zh.md @@ -8,7 +8,7 @@ 文件存储管理能力接口[@ohos.fileio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-fileio.md) -屏幕属性接口[@ohos.display](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-display.md#displaygetdefaultdisplaydeprecated) +屏幕属性接口[@ohos.display](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/js-apis-display.md) 管理窗口能力接口[@ohos.window](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/js-apis-window.md) diff --git a/code/SuperFeature/MultiDeviceAppDev/AdaptiveCapabilities/README_zh.md b/code/SuperFeature/MultiDeviceAppDev/AdaptiveCapabilities/README_zh.md index 56f3779990d211e1765cae8bad1e76da1867f863..11865a05a972908ba6942d99117d209a69497987 100644 --- a/code/SuperFeature/MultiDeviceAppDev/AdaptiveCapabilities/README_zh.md +++ b/code/SuperFeature/MultiDeviceAppDev/AdaptiveCapabilities/README_zh.md @@ -136,8 +136,8 @@ entry/src/main/ets/ ### 具体实现 * 该示例使用了路由跳转接口,实现了各个不同布局之间的页面跳转,通过MediaQueryListener方法查询媒体,matchMediaSync方法设置媒体查询的查询条件。 -* 源码链接:[BreakpointSystem.ets](code/SuperFeature/MultiDeviceAppDev/AdaptiveCapabilities/entry/src/main/ets/common/BreakpointSystem.ets),[DirectoryList.ets](code/SuperFeature/MultiDeviceAppDev/AdaptiveCapabilities/entry/src/main/ets/common/DirectoryList.ets) -* 接口参考:[@ohos.router](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-system-router.md),[@ohos.mediaquery](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-mediaquery.md) +* 源码链接:[BreakpointSystem.ets](entry/src/main/ets/common/BreakpointSystem.ets),[DirectoryList.ets](entry/src/main/ets/common/DirectoryList.ets) +* 接口参考:[@ohos.router](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/js-apis-system-router.md),[@ohos.mediaquery](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-arkui/js-apis-mediaquery.md) ### 相关权限 diff --git a/code/SuperFeature/MultiDeviceAppDev/AppMarket/README_zh.md b/code/SuperFeature/MultiDeviceAppDev/AppMarket/README_zh.md index 22b11e19482f5415e4a12e1c16b349c1eccf437f..cb9c1ec95a3cb564ef7b6cb32d9b38f1c7a94df9 100644 --- a/code/SuperFeature/MultiDeviceAppDev/AppMarket/README_zh.md +++ b/code/SuperFeature/MultiDeviceAppDev/AppMarket/README_zh.md @@ -6,7 +6,7 @@ 本示例使用[一次开发多端部署](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/key-features/multi-device-app-dev)中介绍的自适应布局能力和响应式布局能力进行多设备(或多窗口尺寸)适配,保证应用在不同设备或不同窗口尺寸下可以正常显示。 -用到了媒体查询接口[@ohos.mediaquery](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-mediaquery.md)。 +用到了媒体查询接口[@ohos.mediaquery](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/js-apis-mediaquery.md)。 ### 效果预览 diff --git a/code/SuperFeature/MultiDeviceAppDev/HealthyDiet/README_zh.md b/code/SuperFeature/MultiDeviceAppDev/HealthyDiet/README_zh.md index 725db6170b8ce438766204f378ac50c3015ea5ec..9cbfd35da07f1dd7ccc78d2c029c530d1fedc7cd 100644 --- a/code/SuperFeature/MultiDeviceAppDev/HealthyDiet/README_zh.md +++ b/code/SuperFeature/MultiDeviceAppDev/HealthyDiet/README_zh.md @@ -41,8 +41,8 @@ entry/src/main/ets/ ### 具体实现 * 本实例使用了路由跳转,比如点击食物,可以跳转至相应的食物详情页面,通过一次开发多端部署,使用其中介绍的自适应布局能力和响应式布局能力进行多设备(或多窗口尺寸)适配,保证应用在不同设备或不同窗口尺寸下可以正常显示,使用MediaQueryListener方法查询媒体,matchMediaSync方法设置媒体查询的查询条件,cubicBezierCurve方法构造三阶贝塞尔曲线对象。 -* 源码链接:[BreakpointSystem.ets](code/SuperFeature/MultiDeviceAppDev/HealthyDiet/entry/src/main/ets/common/BreakpointSystem.ets),[FoodDetail.ets](code/SuperFeature/MultiDeviceAppDev/HealthyDiet/entry/src/main/ets/pages/FoodDetail.ets),[Home.ets](code/SuperFeature/MultiDeviceAppDev/HealthyDiet/entry/src/main/ets/pages/Home.ets) -* 接口参考:[@ohos.router](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-system-router.md),[一次开发多端部署](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/key-features/multi-device-app-dev),[@ohos.curves](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-curve.md),[@ohos.mediaquery](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-mediaquery.md) +* 源码链接:[BreakpointSystem.ets](entry/src/main/ets/common/BreakpointSystem.ets),[FoodDetail.ets](entry/src/main/ets/pages/FoodDetail.ets),[Home.ets](entry/src/main/ets/pages/Home.ets) +* 接口参考:[@ohos.router](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/js-apis-system-router.md),[一次开发多端部署](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/key-features/multi-device-app-dev),[@ohos.curves](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/js-apis-curve.md),[@ohos.mediaquery](https://docs.openharmony.cn/pages/v4.1/zh-cn/application-dev/reference/apis-arkui/js-apis-mediaquery.md) ### 相关权限 @@ -60,7 +60,7 @@ entry/src/main/ets/ 3. 本示例需要使用DevEco Studio 3.1 Beta2 (Build Version: 3.1.0.400, built on April 7, 2023)才可编译运行。 -4. 本示例使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/)。 +4. 本示例使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/faqs/full-sdk-switch-guide.md)。 ### 下载 diff --git a/code/SuperFeature/MultiDeviceAppDev/MultiMusic/README_zh.md b/code/SuperFeature/MultiDeviceAppDev/MultiMusic/README_zh.md index 78a88e334e41f0cedb1d78314251dfd0f724f9d8..6d7b8824c468fce730937e13cbbecf0e4b16cef1 100644 --- a/code/SuperFeature/MultiDeviceAppDev/MultiMusic/README_zh.md +++ b/code/SuperFeature/MultiDeviceAppDev/MultiMusic/README_zh.md @@ -4,8 +4,8 @@ 本示例展示了音乐"推荐"与"我的歌单" 两个Tab页签内容。 -* 推荐:采用[栅格](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-gridrow.md)组件、[List](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md)组件、[Grid](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md)组件根据窗口断点进行自适应布局。 -* 我的歌单:通过使用[Grid](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md)组件实现网格布局与列表布局相互切换。 +* 推荐:采用[栅格](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-gridrow.md)组件、[List](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-list.md)组件、[Grid](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-grid.md)组件根据窗口断点进行自适应布局。 +* 我的歌单:通过使用[Grid](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-grid.md)组件实现网格布局与列表布局相互切换。 本示例使用[一次开发多端部署](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/key-features/multi-device-app-dev)中介绍的自适应布局能力和响应式布局能力进行多设备(或多窗口尺寸)适配,主要通过组件提供窗口断点事件,保证应用在不同设备或不同窗口尺寸下可以正常显示。 @@ -52,11 +52,11 @@ MultiMusic/entry/src/main/ets/ **标题栏** -不同容器尺寸下,元素位置不固定,采用[GridRow](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-gridrow.md)组件进行栅格布局,在sm/md断点下,标题栏所有元素占两行,在lg断点下,所有元素只占一行。 +不同容器尺寸下,元素位置不固定,采用[GridRow](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-gridrow.md)组件进行栅格布局,在sm/md断点下,标题栏所有元素占两行,在lg断点下,所有元素只占一行。 **轮播图** -使用[Swiper](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md)组件,通过动态设置[displaycount](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md#%E5%B1%9E%E6%80%A7)属性,显示图片数量根据[窗口断点](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-gridrow.md#gridrowdirection%E6%9E%9A%E4%B8%BE%E7%B1%BB%E5%9E%8B)进行自适应变化,在sm断点下显示一张图片,在md断点下显示两张图片,lg断点下通过if关键字切换成[Row](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-row.md)容器进行布局。 +使用[Swiper](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-swiper.md)组件,通过动态设置[displaycount](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-swiper.md#displaycount8)属性,显示图片数量根据[窗口断点](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-gridrow.md#gridrowdirection%E6%9E%9A%E4%B8%BE%E8%AF%B4%E6%98%8E)进行自适应变化,在sm断点下显示一张图片,在md断点下显示两张图片,lg断点下通过if关键字切换成[Row](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-row.md)容器进行布局。 **音乐分类** @@ -64,7 +64,7 @@ MultiMusic/entry/src/main/ets/ **歌单列表/我的歌单** -使用[Grid](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-grid.md)组件进行响应式布局,元素数量根据[窗口断点](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-gridrow.md#gridrowdirection%E6%9E%9A%E4%B8%BE%E7%B1%BB%E5%9E%8B)进行自适应变化。 +使用[Grid](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-grid.md)组件进行响应式布局,元素数量根据[窗口断点](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-gridrow.md#gridrowdirection%E6%9E%9A%E4%B8%BE%E8%AF%B4%E6%98%8E)进行自适应变化。 ### 相关权限 diff --git a/code/SuperFeature/MultiDeviceAppDev/MultiNavBar/README_zh.md b/code/SuperFeature/MultiDeviceAppDev/MultiNavBar/README_zh.md index ffa6f364e0985c55833295b1b00bdbcf3d5703b5..1f74e579c8971083b58ae40d0f657ec6bb604983 100644 --- a/code/SuperFeature/MultiDeviceAppDev/MultiNavBar/README_zh.md +++ b/code/SuperFeature/MultiDeviceAppDev/MultiNavBar/README_zh.md @@ -5,7 +5,7 @@ 本示例展示了导航组件在不同设备形态下的样式。 * 在sm设备上,以tabs形式展示,内容、导航为上下样式布局,通过点击底部tabs切换内容; -* 在md/lg设备上,以[SideBarContainer](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md)形式展示,内容、导航为左右布局,通过点击侧边一二级菜单进行内容切换。 +* 在md/lg设备上,以[SideBarContainer](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-sidebarcontainer.md)形式展示,内容、导航为左右布局,通过点击侧边一二级菜单进行内容切换。 本示例使用[一次开发多端部署](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/key-features/multi-device-app-dev) 中介绍的自适应布局能力和响应式布局能力进行多设备(或多窗口尺寸)适配,主要通过组件提供窗口断点事件,保证应用在不同设备或不同窗口尺寸下可以正常显示。 @@ -54,7 +54,7 @@ MultiNavBar/entry/src/main/ets/ #### 整体布局 -1.通过GridRow组件提供的断点事件,获取到当前窗口的断点,通过visibility属性将[Tabs](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-tabs.md)组件与[SideBarContainer](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md)组件分别在sm/(md、lg) +1.通过GridRow组件提供的断点事件,获取到当前窗口的断点,通过visibility属性将[Tabs](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-tabs.md)组件与[SideBarContainer](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-sidebarcontainer.md)组件分别在sm/(md、lg) 形态下展示/隐藏。 2.同时通过断点,对组件设置不同的样式属性,以最优的效果展示。 diff --git a/code/SuperFeature/Widget/AdaptiveServiceWidget/README_zh.md b/code/SuperFeature/Widget/AdaptiveServiceWidget/README_zh.md index bee5a9525998ebc005c15b78c4a0ebcd00fced4c..bf7ea5cde4fb8aa61094d3c1eecd93e652f82bf5 100644 --- a/code/SuperFeature/Widget/AdaptiveServiceWidget/README_zh.md +++ b/code/SuperFeature/Widget/AdaptiveServiceWidget/README_zh.md @@ -3,11 +3,11 @@ ### 介绍 本示例展示Js工程中服务卡片的布局和使用,其中卡片内容显示使用了一次开发,多端部署的能力实现多设备自适应。 -用到了卡片扩展模块接口,[@ohos.app.form.FormExtensionAbility](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md) 。 +用到了卡片扩展模块接口,[@ohos.app.form.FormExtensionAbility](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-form-kit/js-apis-app-form-formExtensionAbility.md) 。 -卡片信息和状态等相关类型和枚举接口,[@ohos.app.form.formInfo](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-app-form-formInfo.md) 。 +卡片信息和状态等相关类型和枚举接口,[@ohos.app.form.formInfo](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-form-kit/js-apis-app-form-formInfo.md) 。 -卡片数据绑定的能力接口[@ohos.app.form.formBindingData](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-app-form-formBindingData.md) 。 +卡片数据绑定的能力接口[@ohos.app.form.formBindingData](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/reference/apis-form-kit/js-apis-app-form-formBindingData.md) 。 diff --git a/code/SuperFeature/Widget/ArkTSCard/MusicControl/README_zh.md b/code/SuperFeature/Widget/ArkTSCard/MusicControl/README_zh.md index 148bf05744f31c4da5a7592ab6a38277f4b1f415..2df5d55511cb906a7a9f75d2396ef4138501aa29 100644 --- a/code/SuperFeature/Widget/ArkTSCard/MusicControl/README_zh.md +++ b/code/SuperFeature/Widget/ArkTSCard/MusicControl/README_zh.md @@ -49,14 +49,14 @@ entry/src/main/ets/ 1.本示例仅支持标准系统上运行,支持设备:RK3568。 -2.本示例为Stage模型,支持API10版本SDK,SDK版本号(API Version 10 Release),镜像版本号(4.0 Release)。 +2.本示例为Stage模型,支持API10版本SDK,SDK版本号(API Version 10 Release),镜像版本号(4.0 Release)。 3.本示例需要使用DevEco Studio 版本号(4.0 Release)及以上版本才可编译运行。 -4.本示例需要使用系统权限的系统接口,需要使用Full SDK编译。使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/)。 +4.本示例需要使用系统权限的系统接口,需要使用Full SDK编译。使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md)。 -5.本示例使用了ServiceExtensionAbility,需要在签名证书UnsgnedReleasedProfileTemplate.json中配置"app-privilege-capabilities": ["AllowAppUsePrivilegeExtension"],否则安装失败。具体操作指南可参考[应用特权配置指南](https://gitee.com/openharmony/docs/blob/eb73c9e9dcdd421131f33bb8ed6ddc030881d06f/zh-cn/device-dev/subsystems/subsys-app-privilege-config-guide.md)。 +5.本示例使用了ServiceExtensionAbility,需要在签名证书UnsgnedReleasedProfileTemplate.json中配置"app-privilege-capabilities": ["AllowAppUsePrivilegeExtension"],否则安装失败。具体操作指南可参考[应用特权配置指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/device-dev/subsystems/subsys-app-privilege-config-guide.md)。 -6.本示例所配置的权限均为system_basic或system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/hapsigntool-overview.md/))。 +6.本示例所配置的权限均为system_basic或system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-all.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md))。 -7.本示例类型为系统应用,需要手动配置对应级别的应用类型("app-feature": "hos_system_app")。具体可参考profile配置文件[bundle-info对象内部结构](https://gitee.com/openharmony/docs/blob/eb73c9e9dcdd421131f33bb8ed6ddc030881d06f/zh-cn/application-dev/security/app-provision-structure.md#bundle-info%E5%AF%B9%E8%B1%A1%E5%86%85%E9%83%A8%E7%BB%93%E6%9E%84) +7.本示例类型为系统应用,需要手动配置对应级别的应用类型("app-feature": "hos_system_app")。具体可参考profile配置文件[bundle-info对象内部结构](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/app-provision-structure.md#bundle-info%E5%AF%B9%E8%B1%A1%E5%86%85%E9%83%A8%E7%BB%93%E6%9E%84)。 \ No newline at end of file diff --git a/code/SuperFeature/Widget/FormGame/README_zh.md b/code/SuperFeature/Widget/FormGame/README_zh.md index 9dbe97bcfa77ea57d5076e5733d5a45cf74981ab..bc3eadcedf173c0b16bf53e46ca484cce3a3f8c1 100644 --- a/code/SuperFeature/Widget/FormGame/README_zh.md +++ b/code/SuperFeature/Widget/FormGame/README_zh.md @@ -4,11 +4,11 @@ 本示例展示了如何通过Stage模型实现一个简单的游戏卡片。 -- 通过卡片支持的[点击事件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/js-service-widget-ui/js-service-widget-common-events.md)进行交互,让用户通过点击的先后顺序把一个乱序的成语排列成正确的成语。 +- 通过卡片支持的[点击事件](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-arkui/js-service-widget-ui/js-service-widget-common-events.md)进行交互,让用户通过点击的先后顺序把一个乱序的成语排列成正确的成语。 - 使用了C++和TS的混合编程方式,将获取随机数的能力下沉到C++实现,并通过[NAPI](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/napi/napi-guidelines.md)的能力将C++实现的能力暴露到TS中。 -- 用到了卡片扩展模块接口,[@ohos.app.form.FormExtensionAbility](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md) 。 +- 用到了卡片扩展模块接口,[@ohos.app.form.FormExtensionAbility](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-form-kit/js-apis-app-form-formExtensionAbility.md) 。 @@ -53,7 +53,7 @@ entry/src/main 1、在module.json5文件添加拓展能力,类型为卡片,并设置卡片入口srcEntrance和卡片元数据metadata,[源码参考](entry/src/main/module.json5 )。 2、配置卡片:用js编写相应的卡片,将卡片配置到resources/base/profile/form_config。 -3、定义小游戏逻辑:实现FormExtensionAbility中addform时初始化数据(本sample中使用的是mock数据),并将数据存储到dataStore,通过调用c++随机数,将成语顺序打乱显示, +3、定义小游戏逻辑:实现FormExtensionAbility中addform时初始化数据(本sample中使用的是mock数据),并将数据存储到dataStore,通过调用c++随机数,将成语顺序打乱显示, 4、监听卡片变化:通过onformEvent()监听卡片事件,更新已选择的成语数据,并随机替换成语待选列表的已被选掉的word,[源码参考](entry/src/main/ets/FormAbility/FormAbility.ts )。 ### 相关权限 @@ -68,7 +68,7 @@ entry/src/main 1.本示例仅支持标准系统上运行。 -2.本示例支持API10版本SDK,SDK版本号(API Version 10 Release),镜像版本号(4.0 Release)。 +2.本示例支持API10版本SDK,SDK版本号(API Version 10 Release),镜像版本号(4.0 Release)。 3.本示例需要使用DevEco Studio 版本号(4.0 Release)及以上版本才可编译运行。 diff --git a/code/SuperFeature/Widget/FormGame/entry/src/main/js/widget/pages/index/index.css b/code/SuperFeature/Widget/FormGame/entry/src/main/js/widget/pages/index/index.css index 59982af9b8d7039fbbcf1fc45c0ed10eff9a5107..69843b2bd3126a460a4a9ef171de0cd70c5bccdc 100644 --- a/code/SuperFeature/Widget/FormGame/entry/src/main/js/widget/pages/index/index.css +++ b/code/SuperFeature/Widget/FormGame/entry/src/main/js/widget/pages/index/index.css @@ -28,7 +28,7 @@ #word_title { color: #ff02132d; - font-size: 15vp; + font-size: 15px; } #box_rect { @@ -75,9 +75,10 @@ #word_t { color: #ffb70909; - font-size: 26vp; + font-size: 24px; } #word_s { color: #ff302602; + font-size: 30px; } \ No newline at end of file diff --git a/code/SystemFeature/ApplicationModels/EnterpriseAdminExtensionAbility/README_zh.md b/code/SystemFeature/ApplicationModels/EnterpriseAdminExtensionAbility/README_zh.md index 1c81c25596eecbcb8aa8ac0d9412ac7857fa228d..c4f3ae7ba88e418c06faa0f414b00f514eb91b88 100644 --- a/code/SystemFeature/ApplicationModels/EnterpriseAdminExtensionAbility/README_zh.md +++ b/code/SystemFeature/ApplicationModels/EnterpriseAdminExtensionAbility/README_zh.md @@ -42,7 +42,7 @@ entry/src/main/ets/ 1.允许应用激活设备管理员应用权限:[ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionmanage_enterprise_device_admin) -2.允许设备管理员应用订阅管理事件权限:[ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionenterprise_subscribe_managed_event) +2.允许设备管理员应用订阅管理事件权限:[ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-mdm-apps.md#ohospermissionenterprise_subscribe_managed_event) ### 依赖 @@ -51,10 +51,10 @@ entry/src/main/ets/ ### 约束与限制 1. 本示例仅支持标准系统上运行,支持设备:RK3568。 -2. 本示例已适配API version 9版本SDK,版本号:3.2.11.9,本示例涉及使用系统接口:@ohos.enterprise.adminManager中的enableAdmin、disableAdmin接口,需要手动替换FullSDK才能编译通过,具体操作可参考[替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/)。 +2. 本示例已适配API version 9版本SDK,版本号:3.2.11.9,本示例涉及使用系统接口:@ohos.enterprise.adminManager中的enableAdmin、disableAdmin接口,需要手动替换FullSDK才能编译通过,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md)。 3. 本示例需要使用DevEco Studio 3.1 Beta2 (Build Version: 3.1.0.400 构建 2023年4月7日)及以上版本才可编译运行。 -4. 本示例涉及系统接口,需要配置系统应用签名,可以参考[特殊权限配置方法](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/hapsigntool-overview.md/),把配置文件中的“app-feature”字段信息改为“hos_system_app”。 -5. 本示例涉及ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN为system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)查看),需要配置高权限签名,可参考[特殊权限配置方法](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/hapsigntool-overview.md/)。 +4. 本示例涉及系统接口,需要配置系统应用签名,可以参考[特殊权限配置方法](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md),把配置文件中的“app-feature”字段信息改为“hos_system_app”。 +5. 本示例涉及ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN为system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md)查看),需要配置高权限签名,可参考[特殊权限配置方法](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md)。 6. 本示例涉及企业应用权限,需要进行特殊签名安装,把签名证书中的"app-distribution-type"字段信息修改为"enterprise_mdm"类型,执行签名脚本生成安装包之后,先执行 1. hdc shell param set const.product.developmentmode 1 2. hdc shell param set const.bms.allowenterprisebundle true 这两个命令再进行包安装。 ### 下载 diff --git a/code/SystemFeature/ApplicationModels/Launcher/README_zh.md b/code/SystemFeature/ApplicationModels/Launcher/README_zh.md index 8ffb5a039d65728637b5ef3c8beb7c534cc7babb..75e6cf8c6541004ce58a0578e03f125c1b4acb1e 100644 --- a/code/SystemFeature/ApplicationModels/Launcher/README_zh.md +++ b/code/SystemFeature/ApplicationModels/Launcher/README_zh.md @@ -60,22 +60,22 @@ entry/src/main/ets/ * 应用卸载功能模块 * 使用bundle模块的getBundleInstaller接口获取到BundleInstaller(系统能力:SystemCapability.BundleManager.BundleFramework),调用uninstall接口实现应用卸载功能。 * 源码链接:[LauncherAbilityManager.ts](base/src/main/ets/default/manager/LauncherAbilityManager.ts) - * 接口参考:[@ohos.bundle](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-Bundle.md) + * 接口参考:[@ohos.bundle](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-ability-kit/js-apis-Bundle.md) * 添加卡片功能模块 * 使用formHost接口(系统能力:SystemCapability.Ability.Form),获取应用卡片信息,使用FormComponent组件展示卡片内容,从而实现添加卡片到桌面的功能。 * 源码链接:[FormManager.ts](base/src/main/ets/default/manager/FormManager.ts) - * 接口参考:[@ohos.app.form.formHost](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-app-form-formHost.md) + * 接口参考:[@ohos.app.form.formHost](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-form-kit/js-apis-app-form-formHost-sys.md) * 桌面数据持久化存储功能模块 * 使用关系型数据库rdb接口(系统能力:SystemCapability.DistributedDataManager.RelationalStore.Core),实现桌面数据持久化存储,存储应用的位置信息,卡片信息。 * 源码链接:[RdbManager.ts](base/src/main/ets/default/manager/RdbManager.ts) - * 接口参考:[@ohos.data.relationalStore](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-data-relationalStore.md) + * 接口参考:[@ohos.data.relationalStore](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-arkdata/js-apis-data-relationalStore.md) * 加锁、解锁、清理后台任务功能模块 * 使用missionManager模块接口(系统能力:SystemCapability.Ability.AbilityRuntime.Mission),获取最近任务信息,并实现加锁、解锁、清理后台任务的功能。 * 源码链接:[MissionModel.ts](recents/src/main/ets/default/model/MissionModel.ts) - * 接口参考:[@ohos.application.missionManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-application-missionManager.md) + * 接口参考:[@ohos.application.missionManager](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-ability-kit/js-apis-application-missionManager-sys.md) * 点击桌面应用拉起最近任务至前台功能模块 * 使用ServiceExtensionContext模块的startRecentAbility接口(系统能力:SystemCapability.Ability.AbilityRuntime.Core),拉起最近任务至前台显示,若应用Ability未启动时,则拉起新创建的应用Ability显示到前台。 @@ -102,17 +102,17 @@ entry/src/main/ets/ 1.本示例仅支持标准系统上运行,支持设备:RK3568。 -2.本示例为Stage模型,支持API10版本SDK,SDK版本号(API Version 10 Release),镜像版本号(4.0 Release)。 +2.本示例为Stage模型,支持API10版本SDK,SDK版本号(API Version 10 Release),镜像版本号(4.0 Release)。 3.本示例需要使用DevEco Studio 版本号(4.0 Release)及以上版本才可编译运行。 -4.本示例需要使用系统权限的系统接口,需要使用Full SDK编译。使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南]( https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/ )。 +4.本示例需要使用系统权限的系统接口,需要使用Full SDK编译。使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md)。 -5.本示例使用了ServiceExtensionAbility,需要在签名证书UnsgnedReleasedProfileTemplate.json中配置"app-privilege-capabilities": ["AllowAppUsePrivilegeExtension"],否则安装失败。具体操作指南可参考[应用特权配置指南]( https://gitee.com/openharmony/docs/blob/eb73c9e9dcdd421131f33bb8ed6ddc030881d06f/zh-cn/device-dev/subsystems/subsys-app-privilege-config-guide.md/ )。 +5.本示例使用了ServiceExtensionAbility,需要在签名证书UnsgnedReleasedProfileTemplate.json中配置"app-privilege-capabilities": ["AllowAppUsePrivilegeExtension"],否则安装失败。具体操作指南可参考[应用特权配置指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/device-dev/subsystems/subsys-app-privilege-config-guide.md)。 -6.本示例所配置的权限均为system_basic或system_core级别(相关权限级别可通过[权限定义列表]( https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md )查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案]( https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/hapsigntool-overview.md/ ))。 +6.本示例所配置的权限均为system_basic或system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md))。 -7.本示例类型为系统应用,需要手动配置对应级别的应用类型("app-feature": "hos_system_app")。具体可参考profile配置文件[bundle-info对象内部结构]( https://gitee.com/openharmony/docs/blob/eb73c9e9dcdd421131f33bb8ed6ddc030881d06f/zh-cn/application-dev/security/app-provision-structure.md#bundle-info%E5%AF%B9%E8%B1%A1%E5%86%85%E9%83%A8%E7%BB%93%E6%9E%84 ) +7.本示例类型为系统应用,需要手动配置对应级别的应用类型("app-feature": "hos_system_app")。具体可参考profile配置文件[bundle-info对象内部结构](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/app-provision-structure.md#bundle-info%E5%AF%B9%E8%B1%A1%E5%86%85%E9%83%A8%E7%BB%93%E6%9E%84)。 ### 下载 diff --git a/code/SystemFeature/ApplicationModels/MissionManager/README_zh.md b/code/SystemFeature/ApplicationModels/MissionManager/README_zh.md index 550901785c4cfce1b8978b48120c88406481b7be..abab1a0ab9ddb6e40b9fa85a1ccca0611200b55b 100644 --- a/code/SystemFeature/ApplicationModels/MissionManager/README_zh.md +++ b/code/SystemFeature/ApplicationModels/MissionManager/README_zh.md @@ -2,7 +2,7 @@ ### 介绍 -本示例通过调用系统任务管理的能力,使用[@ohos.application.missionManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-application-missionManager.md) 、[@ohos.multimedia.image](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md) 等接口完成对系统任务执行锁定、解锁、清理、切换到前台等操作。 +本示例通过调用系统任务管理的能力,使用[@ohos.application.missionManager](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-ability-kit/js-apis-application-missionManager-sys.md) 、[@ohos.multimedia.image](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-image-kit/js-apis-image.md) 等接口完成对系统任务执行锁定、解锁、清理、切换到前台等操作。 ### 效果预览 @@ -57,11 +57,11 @@ entry/src/main/ets/ 1.本示例仅支持在标准系统上运行。 -2.本示例已适配API version 9版本SDK,本示例涉及使用系统接口:@ohos.application.missionManager,需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/)。 +2.本示例已适配API version 9版本SDK,本示例涉及使用系统接口:@ohos.application.missionManager,需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md)。 3.本示例需要使用DevEco Studio 3.1 Beta2 (Build Version: 3.1.0.400, built on April 7, 2023)及以上版本才可编译运行。 -4.本示例所配置的权限ohos.permission.MANAGE_MISSIONS为system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/hapsigntool-overview.md/))。 +4.本示例所配置的权限ohos.permission.MANAGE_MISSIONS为system_core级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md))。 ### 下载 @@ -72,5 +72,4 @@ git config core.sparsecheckout true echo code/SystemFeature/ApplicationModels/MissionManager/ > .git/info/sparse-checkout git remote add origin https://gitee.com/openharmony/applications_app_samples.git git pull origin master - ``` diff --git a/code/SystemFeature/ApplicationModels/StageModel/README_zh.md b/code/SystemFeature/ApplicationModels/StageModel/README_zh.md index 355ef19cf4c5f519be4dc708a52af25a8912981d..1f1b6a47b1511b8de086359d22edd9cd54cff172 100644 --- a/code/SystemFeature/ApplicationModels/StageModel/README_zh.md +++ b/code/SystemFeature/ApplicationModels/StageModel/README_zh.md @@ -2,7 +2,7 @@ ### 介绍 -[Stage模型](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/ability-deprecated/stage-brief.md) 的设计,主要是为了解决FA模型无法解决的开发场景问题,方便开发者更加方便地开发出分布式环境下的复杂应用。 +[Stage模型](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/application-models/stage-model-development-overview.md) 的设计,主要是为了解决FA模型无法解决的开发场景问题,方便开发者更加方便地开发出分布式环境下的复杂应用。 #### Stage和FA模型的区别 @@ -10,7 +10,7 @@ 2.Stage模型中卡片的创建需要的配置文件在resources/base/profile/form_config.json。 -3.Stage模型中ability生命周期与FA模型生命周期见[Stage模型生命周期](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/ability-deprecated/stage-brief.md#%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F) ,[FA模型生命周期](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/ability-deprecated/fa-brief.md#%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F) 。 +3.Stage模型中ability生命周期与FA模型生命周期见[Stage模型生命周期](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/application-models/uiability-lifecycle.md) ,[FA模型生命周期](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/application-models/pageability-lifecycle.md) 。 4.Stage模型中DataShareExtensionAbility对应FA模型中dataAbility,具体实现差异详见方法注释。 diff --git a/code/SystemFeature/ApplicationModels/TestRely/LauncherTest/CrossChainBack/README_zh.md b/code/SystemFeature/ApplicationModels/TestRely/LauncherTest/CrossChainBack/README_zh.md index f5de983ee07cff49742ea6f89874c69b9d4cf742..140d1dfa27d4dd725edfc71683f3f066bd7f4bf9 100644 --- a/code/SystemFeature/ApplicationModels/TestRely/LauncherTest/CrossChainBack/README_zh.md +++ b/code/SystemFeature/ApplicationModels/TestRely/LauncherTest/CrossChainBack/README_zh.md @@ -50,7 +50,7 @@ entry/src/main/ets/ ### 相关权限 -[ohos.permission.START_ABILITIES_FROM_BACKGROUND](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md) +[ohos.permission.START_ABILITIES_FROM_BACKGROUND](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionstart_abilities_from_background) ### 依赖 @@ -64,9 +64,9 @@ entry/src/main/ets/ 3.本示例需要使用DevEco Studio 3.1 Beta2 (Build Version: 3.1.0.400 构建 2023年4月7日)才可编译运行。 -4.本示例使用了ServiceExtensionAbility,需要在签名证书UnsgnedReleasedProfileTemplate.json中配置"app-privilege-capabilities": ["AllowAppUsePrivilegeExtension"],否则安装失败。具体操作指南可参考[应用特权配置指南](https://gitee.com/openharmony/docs/blob/eb73c9e9dcdd421131f33bb8ed6ddc030881d06f/zh-cn/device-dev/subsystems/subsys-app-privilege-config-guide.md/)。 +4.本示例使用了ServiceExtensionAbility,需要在签名证书UnsgnedReleasedProfileTemplate.json中配置"app-privilege-capabilities": ["AllowAppUsePrivilegeExtension"],否则安装失败。具体操作指南可参考[应用特权配置指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/device-dev/subsystems/subsys-app-privilege-config-guide.md)。 -5.本示例所配置的权限为system_basic级别(相关权限级别可通过[权限定义列表]( https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md )查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/hapsigntool-overview.md/))。 +5.本示例所配置的权限为system_basic级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md))。 ### 下载 diff --git a/code/SystemFeature/ApplicationModels/UIExtensionAbility/README_zh.md b/code/SystemFeature/ApplicationModels/UIExtensionAbility/README_zh.md index ae11122b1cee53a5091f74e9ef7f8c1294861159..87413b0c688dfe119bd3c11ca363fa468f35f365 100644 --- a/code/SystemFeature/ApplicationModels/UIExtensionAbility/README_zh.md +++ b/code/SystemFeature/ApplicationModels/UIExtensionAbility/README_zh.md @@ -79,9 +79,9 @@ entry/src/main/resources 1. 本示例仅支持标准系统上运行,支持设备:RK3568; -2. 本示例开发中需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/)。 +2. 本示例开发中需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md)。 -3. UIExtensionAbility仅支持系统应用,需要配置系统应用签名,可以参考[特殊权限配置方法](https://docs.openharmony.cn/pages/v3.2Beta/zh-cn/application-dev/security/hapsigntool-overview.md/),把配置文件中的“apl”字段信息改为“system_basic”。 +3. UIExtensionAbility仅支持系统应用,需要配置系统应用签名,可以参考[特殊权限配置方法](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md),把配置文件中的“apl”字段信息改为“system_basic”。 4. 本示例需要使用DevEco Studio 4.0 Beta2 (Build Version: 4.0.0.400 构建 2023年8月2日)及以上版本才可编译运行。 diff --git a/code/SystemFeature/Connectivity/Bluetooth/README_zh.md b/code/SystemFeature/Connectivity/Bluetooth/README_zh.md index 10754c61e9d3c68dcbd5b48f2104afc8befb4c21..86eebf2bb40f829e2797ea7a71a7172d896f8a9b 100644 --- a/code/SystemFeature/Connectivity/Bluetooth/README_zh.md +++ b/code/SystemFeature/Connectivity/Bluetooth/README_zh.md @@ -2,7 +2,7 @@ ### 介绍 -蓝牙技术是一种无线数据和语音通信开放的全球规范,它是基于低成本的近距离无线连接,为固定和移动设备建立通信环境的一种特殊的近距离无线技术连接。本示例通过[@ohos.bluetooth](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-bluetooth.md) 接口实现蓝牙设备发现、配对、取消配对功能。实现效果如下: +蓝牙技术是一种无线数据和语音通信开放的全球规范,它是基于低成本的近距离无线连接,为固定和移动设备建立通信环境的一种特殊的近距离无线技术连接。本示例通过[@ohos.bluetooth](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-sys.md) 接口实现蓝牙设备发现、配对、取消配对功能。实现效果如下: ### 效果预览 @@ -42,15 +42,15 @@ entry/src/main/ets/ ### 相关权限 -[ohos.permission.USE_BLUETOOTH](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionuse_bluetooth) +[ohos.permission.USE_BLUETOOTH](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionuse_bluetooth) -[ohos.permission.LOCATION](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionlocation) +[ohos.permission.LOCATION](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionlocation) -[ohos.permission.DISCOVER_BLUETOOTH](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissiondiscover_bluetooth) +[ohos.permission.DISCOVER_BLUETOOTH](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissiondiscover_bluetooth) -[ohos.permission.MANAGE_BLUETOOTH](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionmanage_bluetooth) +[ohos.permission.MANAGE_BLUETOOTH](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionmanage_bluetooth) -[ohos.permission.APPROXIMATELY_LOCATION](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionapproximately_location) +[ohos.permission.APPROXIMATELY_LOCATION](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionapproximately_location) ### 依赖 @@ -60,11 +60,11 @@ entry/src/main/ets/ 1.本示例仅支持标准系统上运行。 -2.本示例已适配API version 9版本SDK,本示例涉及使用系统接口:cancelPairedDevice(),需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/) 。 +2.本示例已适配API version 9版本SDK,本示例涉及使用系统接口:cancelPairedDevice(),需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md) 。 3.本示例需要使用DevEco Studio 3.1 Beta2 (Build Version: 3.1.0.400, built on April 7, 2023)及以上版本才可编译运行。 -4.本示例所配置的权限ohos.permission.MANAGE_BLUETOOTH为system_basic级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md) 查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/hapsigntool-overview.md/)) 。 +4.本示例所配置的权限ohos.permission.MANAGE_BLUETOOTH为system_basic级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md) 查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md)) 。 ### 下载 diff --git a/code/SystemFeature/DataManagement/CrossAppDataShare/README_zh.md b/code/SystemFeature/DataManagement/CrossAppDataShare/README_zh.md index a3e07715d247417b4dde7bf167652e8ef3d64be8..db63e943a224ea581fec7d7294dde353e696b68d 100644 --- a/code/SystemFeature/DataManagement/CrossAppDataShare/README_zh.md +++ b/code/SystemFeature/DataManagement/CrossAppDataShare/README_zh.md @@ -43,7 +43,7 @@ dataProvider/src/main/ets/ * 使用DataShareExtensionAbility实现数据共享,关系型数据库实现数据的增、删、改、查接口,DataShare管理和访问数据库数据变化。 * 源码链接:[DataShareAbility.ts](code/SystemFeature/DataManagement/CrossAppDataShare/dataProvider/src/main/ets/DataShareAbility/DataShareAbility.ts),[ContactEdit.ets](code/SystemFeature/DataManagement/CrossAppDataShare/dataProvider/src/main/ets/pages/ContactEdit.ets),[ContactStore.ets](code/SystemFeature/DataManagement/CrossAppDataShare/dataUser/src/main/ets/feature/ContactStore.ets) -* 接口参考:[@ohos.data.DataShareResultSet](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-application-dataShareExtensionAbility.md),[@ohos.data.relationalStore](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-data-dataShare.md),[@ohos.data.rdb](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-data-rdb.md) +* 接口参考:[@ohos.data.DataShareResultSet](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkdata/js-apis-application-dataShareExtensionAbility-sys.md),[@ohos.data.relationalStore](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-arkdata/js-apis-data-dataShare-sys.md),[@ohos.data.rdb](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-arkdata/js-apis-data-rdb.md) ### 相关权限 @@ -61,9 +61,9 @@ dataProvider/src/main/ets/ 3. 本示例需要使用DevEco Studio 3.1 Beta2 (Build Version: 3.1.0.400, built on April 7, 2023)才可编译运行。 -4. 本示例需要使用@ohos.data.dataShare,@ohos.data.dataSharePredicates,@ohos.data.ValuesBucket系统权限的系统接口。使用Full SDK时需要手动从镜像站点获取,并在DevEcoStudio中替换,具体操作可参考 [替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/) 。 +4. 本示例需要使用@ohos.data.dataShare,@ohos.data.dataSharePredicates,@ohos.data.ValuesBucket系统权限的系统接口。使用Full SDK时需要手动从镜像站点获取,并在DevEcoStudio中替换,具体操作可参考 [替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md) 。 -5. 本示例使用了DataShareExtensionAbility,安装需要手动配置签名,具体操作可查看[自动化签名方案](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/hapsigntool-overview.md/)。 +5. 本示例使用了DataShareExtensionAbility,安装需要手动配置签名,具体操作可查看[自动化签名方案](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md)。 ### 下载 @@ -74,5 +74,4 @@ git config core.sparsecheckout true echo code/SystemFeature/DataManagement/CrossAppDataShare/ > .git/info/sparse-checkout git remote add origin https://gitee.com/openharmony/applications_app_samples.git git pull origin master - ``` diff --git a/code/SystemFeature/DeviceManagement/DeviceManagementCollection/README_zh.md b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/README_zh.md index 168a56e5510b204c1c94418daecd247a8e71e1c9..9ab5121ccdcd81b89709f29a28b37a874d0aeaed 100644 --- a/code/SystemFeature/DeviceManagement/DeviceManagementCollection/README_zh.md +++ b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/README_zh.md @@ -4,24 +4,24 @@ 本示例集合设备管理相关(系统特性)不需要复杂功能展示的模块,展示了各个模块的基础功能,包含: -- [@ohos.batteryStatistics (耗电统计)](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/reference/apis/js-apis-batteryStatistics.md/) -- [@ohos.brightness (屏幕亮度)](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/reference/apis/js-apis-brightness.md/) -- [@ohos.power (系统电源管理)](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/reference/apis/js-apis-power.md/) -- [@ohos.settings (设置数据项名称)](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/reference/apis/js-apis-settings.md/) -- [@ohos.systemCapability (系统能力)](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/reference/apis/js-apis-system-capability.md/) -- [@ohos.systemParameterEnhance (系统参数)](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/reference/apis/js-apis-system-parameterEnhance.md/) -- [@ohos.batteryInfo (电量信息)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-battery-info.md) -- [@ohos.deviceInfo (设备信息)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-device-info.md) -- [@ohos.multimodalInput.inputConsumer (组合按键)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md) -- [@ohos.multimodalInput.inputDevice (输入设备)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md) -- [@ohos.multimodalInput.inputEvent (输入事件)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-inputevent.md) -- [@ohos.multimodalInput.inputEventClient (按键注入)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-inputeventclient.md) -- [@ohos.multimodalInput.inputMonitor (输入监听)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md) -- [@ohos.multimodalInput.keyCode (键值)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-keycode.md) -- [@ohos.multimodalInput.keyEvent (按键输入事件)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-keyevent.md) -- [@ohos.multimodalInput.mouseEvent (鼠标输入事件)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-mouseevent.md) -- [@ohos.multimodalInput.pointer (鼠标指针)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-pointer.md) -- [@ohos.multimodalInput.touchEvent (触摸输入事件)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-touchevent.md) +- [@ohos.batteryStatistics (耗电统计)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-batteryStatistics-sys.md/) +- [@ohos.brightness (屏幕亮度)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-brightness-sys.md/) +- [@ohos.power (系统电源管理)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-power-sys.md/) +- [@ohos.settings (设置数据项名称)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-settings.md/) +- [@ohos.systemCapability (系统能力)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-system-capability-sys.md/) +- [@ohos.systemParameterEnhance (系统参数)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-system-parameterEnhance-sys.md/) +- [@ohos.batteryInfo (电量信息)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-battery-info-sys.md) +- [@ohos.deviceInfo (设备信息)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-device-info.md) +- [@ohos.multimodalInput.inputConsumer (组合按键)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-inputconsumer.md) +- [@ohos.multimodalInput.inputDevice (输入设备)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-inputdevice.md) +- [@ohos.multimodalInput.inputEvent (输入事件)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-inputevent.md) +- [@ohos.multimodalInput.inputEventClient (按键注入)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-inputeventclient-sys.md) +- [@ohos.multimodalInput.inputMonitor (输入监听)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-inputmonitor-sys.md) +- [@ohos.multimodalInput.keyCode (键值)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-keycode.md) +- [@ohos.multimodalInput.keyEvent (按键输入事件)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-keyevent.md) +- [@ohos.multimodalInput.mouseEvent (鼠标输入事件)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-mouseevent.md) +- [@ohos.multimodalInput.pointer (鼠标指针)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-pointer.md) +- [@ohos.multimodalInput.touchEvent (触摸输入事件)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-touchevent.md) ### 效果预览 @@ -53,7 +53,7 @@ 7.系统能力:获取系统能力集合的字符串并显示。 -8.系统参数:点击按钮分别实现设置一个系统参数、获取并展示系统参数功能。 +8.系统参数:点击按钮分别实现设置一个系统参数、获取并展示系统参数功能。(需要配置selinux权限) 9.电量信息:进入设备电量信息页面,页面主要显示电量信息,包括:当前设备是否支持电池或电池是否在位的查询、剩余电池电量百分比、充电状态、电池健康状态、充电器类型、电池电压、电池技术型号、电池温度、电量等级等信息。 @@ -131,52 +131,52 @@ DeviceManagementCollection 1.首页菜单展示:使用一个module,menuitems完成菜单组件的实现,传入要展示的菜单的strarray类型的资源和菜单点击对应的组件即可。使用Navigation和NavRouter组件实现菜单点击进入功能界面,使用LocalStorage实现应用内Ability内数据共享,点击菜单时标记selectedLabel,在entry中的Capabilities组件中,通过selectedLabel显示对应的功能组件。 -2.耗电统计:使用[@ohos.batteryStatistics.d.ts](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/reference/apis/js-apis-batteryStatistics.md/) -接口获取硬件和应用的耗电量与百分比,使用[@ohos.bundle.bundleManager.d.ts](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/reference/apis/js-apis-bundleManager.md/) +2.耗电统计:使用[@ohos.batteryStatistics.d.ts](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-batteryStatistics-sys.md/) +接口获取硬件和应用的耗电量与百分比,使用[@ohos.bundle.bundleManager.d.ts](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-ability-kit/js-apis-bundleManager.md/) 接口获取系统已安装应用信息。 -3.屏幕亮度:使用[@ohos.brightness.d.ts](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/reference/apis/js-apis-brightness.md/) +3.屏幕亮度:使用[@ohos.brightness.d.ts](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-brightness-sys.md/) 实现屏幕亮度控制。 -4.系统电源管理:使用[@ohos.power.d.ts](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/reference/apis/js-apis-power.md/) +4.系统电源管理:使用[@ohos.power.d.ts](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-power-sys.md/) 实现休眠、关机、重启、设置电源模式功能。 -5.设置数据项名称:使用[@ohos.settings.d.ts](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/reference/apis/js-apis-settings.md/) +5.设置数据项名称:使用[@ohos.settings.d.ts](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-settings.md/) 实现将数据项名称及数据项的值保存到数据库中。 -6.系统能力:使用[@ohos.systemCapability.d.ts](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/reference/apis/js-apis-system-capability.md/) +6.系统能力:使用[@ohos.systemCapability.d.ts](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-system-capability-sys.md/) 实现获取系统能力集合的字符串并显示。 -7.系统参数:使用[@ohos.systemParameterEnhance.d.ts](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/reference/apis/js-apis-system-parameterEnhance.md/) +7.系统参数:使用[@ohos.systemParameterEnhance.d.ts](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-system-parameterEnhance-sys.md/) 实现设置一个系统参数、获取并展示系统参数功能。 -8.电量信息:使用[@ohos.batteryInfo.d.ts](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-battery-info.md)接口获取电池和充放电状态信息 +8.电量信息:使用[@ohos.batteryInfo.d.ts](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-battery-info-sys.md)接口获取电池和充放电状态信息 -9.设备信息:使用[@ohos.deviceInfo](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-device-info.md)获取设备相关信息。 +9.设备信息:使用[@ohos.deviceInfo](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-basic-services-kit/js-apis-device-info.md)获取设备相关信息。 -10.组合按键:使用[@ohos.multimodalInput.inputConsumer](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md) 订阅组合按键,当组合按键被触发时展示组合按键回调信息。 +10.组合按键:使用[@ohos.multimodalInput.inputConsumer](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-inputconsumer.md) 订阅组合按键,当组合按键被触发时展示组合按键回调信息。 -11.输入设备:使用[@ohos.multimodalInput.inputDevice](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md) 获取输入设备列表,并显示输入设备信息,实现设备的热插拔监听。 +11.输入设备:使用[@ohos.multimodalInput.inputDevice](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-inputdevice.md) 获取输入设备列表,并显示输入设备信息,实现设备的热插拔监听。 -12.输入事件:使用[@ohos.multimodalInput.inputMonitor](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md)开启监听全局触屏事件,当触发触屏事件时显示触屏详情,使用[@ohos.multimodalInput.inputEventClient](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-inputeventclient.md)模拟返回按键进行按键注入,实现返回功能,在column组件中添加[@ohos.multimodalInput.touchEvent](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-touchevent.md)触摸事件,模拟按键被按下效果。 +12.输入事件:使用[@ohos.multimodalInput.inputMonitor](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-inputevent.md)开启监听全局触屏事件,当触发触屏事件时显示触屏详情,使用[@ohos.multimodalInput.inputEventClient](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-inputeventclient-sys.md)模拟返回按键进行按键注入,实现返回功能,在column组件中添加[@ohos.multimodalInput.touchEvent](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-touchevent.md)触摸事件,模拟按键被按下效果。 -13.鼠标指针:使用[@ohos.multimodalInput.mouseEvent](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-mouseevent.md)监听鼠标事件,并显示鼠标操作回调信息,使用[@ohos.multimodalInput.pointer](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-pointer.md)实现鼠标指针的显示或隐藏状态,设置鼠标移动速度和显示样式。 +13.鼠标指针:使用[@ohos.multimodalInput.mouseEvent](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-mouseevent.md)监听鼠标事件,并显示鼠标操作回调信息,使用[@ohos.multimodalInput.pointer](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-pointer.md)实现鼠标指针的显示或隐藏状态,设置鼠标移动速度和显示样式。 -14.输入按键事件:使用 [@ohos.multimodalInput.keyEvent (按键输入事件)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-keyevent.md)监听按键输入的信息。 +14.输入按键事件:使用 [@ohos.multimodalInput.keyEvent (按键输入事件)](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-keyevent.md)监听按键输入的信息。 ### 相关权限 -1.允许应用重启设备权限:[ohos.permission.REBOOT](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.2-Release/zh-cn/application-dev/security/permission-list.md#ohospermissionreboot) +1.允许应用重启设备权限:[ohos.permission.REBOOT](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionreboot) -2.允许系统应用设置省电模式、获取省电模式的配置信息并接收配置变化的通知权限:[ohos.permission.POWER_OPTIMIZATION](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.2-Release/zh-cn/application-dev/security/permission-list.md#ohospermissionpower_optimization) +2.允许系统应用设置省电模式、获取省电模式的配置信息并接收配置变化的通知权限:[ohos.permission.POWER_OPTIMIZATION](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionpower_optimization) -3.允许应用查询已安装应用的信息权限:[ohos.permission.GET_BUNDLE_INFO_PRIVILEGED](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.2-Release/zh-cn/application-dev/security/permission-list.md#ohospermissionget_bundle_info_privileged) +3.允许应用查询已安装应用的信息权限:[ohos.permission.GET_BUNDLE_INFO_PRIVILEGED](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionget_bundle_info_privileged) -4.允许系统应用获取UDID权限:[ohos.permission.sec.ACCESS_UDID](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionsecaccess_udid) +4.允许系统应用获取UDID权限:[ohos.permission.sec.ACCESS_UDID](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionsecaccess_udid) -5.允许应用监听输入事件权限:[ohos.permission.INPUT_MONITORING](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissioninput_monitoring) +5.允许应用监听输入事件权限:[ohos.permission.INPUT_MONITORING](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissioninput_monitoring) -6.允许应用读取已安装应用列表:[ohos.permission.GET_INSTALLED_BUNDLE_LIST](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionget_installed_bundle_list) +6.允许应用读取已安装应用列表:[ohos.permission.GET_INSTALLED_BUNDLE_LIST](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionget_installed_bundle_list) ### 依赖 不涉及。 @@ -190,12 +190,12 @@ DeviceManagementCollection 3.本示例需要使用DevEco Studio 版本号(4.0Release)才可编译运行。 4.本示例需要使用系统权限的系统接口。使用Full SDK时需要手动从镜像站点获取,并在DevEco -Studio中替换,具体操作可参考[替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/)。 +Studio中替换,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md/)。 5.本示例所配置的REBOOT、POWER_OPTIMIZATION、GET_BUNDLE_INFO_PRIVILEGED权限为system_basic或system_core级别( -相关权限级别可通过[权限定义列表]( https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/permission-list.md/ ) +相关权限级别可通过[权限定义列表]( https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-all.md/ ) 查看),需要手动配置对应级别的权限签名( -具体操作可查看[自动化签名方案]( https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/hapsigntool-overview.md/ ))。 +具体操作可查看[自动化签名方案]( https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md/ ))。 ### 下载 diff --git a/code/SystemFeature/DeviceManagement/Mouse/README_zh.md b/code/SystemFeature/DeviceManagement/Mouse/README_zh.md index 11f434bde12aeb4730366e441dbca59e013c736d..2e26760b6c2d9ecc2bbb16689260a1b3b3705d09 100644 --- a/code/SystemFeature/DeviceManagement/Mouse/README_zh.md +++ b/code/SystemFeature/DeviceManagement/Mouse/README_zh.md @@ -4,7 +4,7 @@ 本示例展示了多模输入鼠标外设的五种场景:鼠标样式资源切换、设置鼠标大小及颜色、设置鼠标动画光标样式、通过switch开关切换鼠标滚轮在非激活悬停窗口的滚动操作使能状态、通过switch开关切换鼠标主次键等功能。 -本实例使用[鼠标指针](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-pointer.md) +本实例使用[鼠标指针](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-pointer.md) ### 效果预览 @@ -41,7 +41,7 @@ entry/src/main/ets/ * 鼠标外设模块 * 主要展示了鼠标外设的五种功能设置场景 * 源码链接:[Main.ets](entry/src/main/ets/pages/Main.ets), - * 接口参考:[@ohos.multimodalInput.pointer](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-pointer.md) + * 接口参考:[@ohos.multimodalInput.pointer](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-input-kit/js-apis-pointer.md) ### 相关权限 @@ -63,11 +63,11 @@ entry/src/main/ets/ 3.本示例需要使用DevEco Studio 版本号(4.0 Release)及以上版本才可编译运行; -4.本示例涉及使用系统接口@ohos.multimodalInput.pointer:setPointerSize,需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/) +4.本示例涉及使用系统接口@ohos.multimodalInput.pointer:setPointerSize,需要手动替换Full SDK才能编译通过,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md) -5.本示例所配置的权限为system_basic级别(相关权限级别可通过[权限定义列表](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/permission-list.md/)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/hapsigntool-overview.md/)) +5.本示例所配置的权限为system_basic级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md)) -6.本示例有使用系统特性api,需要手动配置对应级别的应用类型("app-feature": "hos_system_app")。具体可参考profile配置文件[bundle-info对象内部结构](https://gitee.com/openharmony/docs/blob/eb73c9e9dcdd421131f33bb8ed6ddc030881d06f/zh-cn/application-dev/security/app-provision-structure.md#bundle-info%E5%AF%B9%E8%B1%A1%E5%86%85%E9%83%A8%E7%BB%93%E6%9E%84) +6.本示例有使用系统特性api,需要手动配置对应级别的应用类型("app-feature": "hos_system_app")。具体可参考profile配置文件[bundle-info对象内部结构](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/app-provision-structure.md#bundle-info%E5%AF%B9%E8%B1%A1%E5%86%85%E9%83%A8%E7%BB%93%E6%9E%84) ### 下载 diff --git a/code/SystemFeature/DeviceManagement/Screen/README_zh.md b/code/SystemFeature/DeviceManagement/Screen/README_zh.md index 59a721a36f22518023e667b5153a95bd105c45fc..fa3874ce8878eef72bdfa70650ae70f371907d5d 100644 --- a/code/SystemFeature/DeviceManagement/Screen/README_zh.md +++ b/code/SystemFeature/DeviceManagement/Screen/README_zh.md @@ -2,7 +2,7 @@ ### 介绍 -本示例主要展示了屏幕管理相关的功能,使用[@ohos.display](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-display.md)、[@ohos.screen](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-screen.md)接口,[@ohos.display](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-display.md)接口提供获取默认display对象、获取所有display对象,开启监听、关闭监听功能;[@ohos.screen](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-screen.md)接口提供创建虚拟屏幕、销毁虚拟屏幕、扩展屏幕、镜像屏幕等功能。 +本示例主要展示了屏幕管理相关的功能,使用[@ohos.display](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-arkui/js-apis-display-sys.md)、[@ohos.screen](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-arkui/js-apis-screen-sys.md)接口,[@ohos.display](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-arkui/js-apis-display-sys.md)接口提供获取默认display对象、获取所有display对象,开启监听、关闭监听功能;[@ohos.screen](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-arkui/js-apis-screen-sys.md)接口提供创建虚拟屏幕、销毁虚拟屏幕、扩展屏幕、镜像屏幕等功能。 ### 效果预览 @@ -63,7 +63,7 @@ entry/src/main/ets/ 4.本示例需要使用DevEco Studio 版本号(4.0 Release)及以上版本才可编译运行。 -5.本示例需要使用@ohos.screen系统权限的系统接口。使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/)。 +5.本示例需要使用@ohos.screen系统权限的系统接口。使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md)。 ### 下载 diff --git a/code/SystemFeature/DeviceManagement/StorageStatistic/README_zh.md b/code/SystemFeature/DeviceManagement/StorageStatistic/README_zh.md index 5695cf36e95a043c22a536c0184f7b2d764378c9..3517a3ab7bad1c78935250eaa46d07423697f7d6 100644 --- a/code/SystemFeature/DeviceManagement/StorageStatistic/README_zh.md +++ b/code/SystemFeature/DeviceManagement/StorageStatistic/README_zh.md @@ -48,15 +48,15 @@ entry/src/main/ets/ * 本示例使用DataPanel组件展示不同种类的应用存储信息,通过 Bundle模块来获取不同应用的包名与应用名等信息,使用应用空间统计来查询当前设备的存储使用情况,使用卷管理来查询可用卷存储使用情况。 * 源码链接:[QueryStorageData.ets](entry/src/main/ets/common/QueryStorageData.ets),[QueryVolumeData.ets](entry/src/main/ets/common/QueryVolumeData.ets) -* 接口参考:[DataPanel组件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-datapanel.md),[@ohos.bundle.bundleManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-Bundle.md),[@ohos.file.storageStatistics](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-file-storage-statistics.md),[@ohos.file.volumeManager](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-file-volumemanager.md) +* 接口参考:[DataPanel组件](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-datapanel.md),[@ohos.bundle.bundleManager](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-ability-kit/js-apis-bundleManager-sys.md),[@ohos.file.storageStatistics](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-storage-statistics-sys.md),[@ohos.file.volumeManager](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/reference/apis-core-file-kit/js-apis-file-volumemanager-sys.md) ### 相关权限 -1. 允许获取存储信息与可用卷信息:[ohos.permission.STORAGE_MANAGER](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionstorage_manager) +1. 允许获取存储信息与可用卷信息:[ohos.permission.STORAGE_MANAGER](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionstorage_manager) -2. 允许获取已安装应用的信息:[ohos.permission.GET_BUNDLE_INFO_PRIVILEGED](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionget_bundle_info_privileged) +2. 允许获取已安装应用的信息:[ohos.permission.GET_BUNDLE_INFO_PRIVILEGED](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionget_bundle_info_privileged) -3. 允许应用读取已安装应用列表:[ohos.permission.GET_INSTALLED_BUNDLE_LIST](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionget_installed_bundle_list) +3. 允许应用读取已安装应用列表:[ohos.permission.GET_INSTALLED_BUNDLE_LIST](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionget_installed_bundle_list) ### 依赖 @@ -70,9 +70,9 @@ entry/src/main/ets/ 3. 本示例需要使用DevEco Studio 版本号(4.0 Release)及以上版本才可编译运行。 -4. 本示例需要使用@ohos.bundle.innerBundleManager,@ohos.volumeManager,@ohos.storageStatistics系统权限的系统接口。使用Full SDK时需要手动从镜像站点获取,并在DevEcoStudio中替换,具体操作可参考 [替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/) 。 +4. 本示例需要使用@ohos.bundle.innerBundleManager,@ohos.volumeManager,@ohos.storageStatistics系统权限的系统接口。使用Full SDK时需要手动从镜像站点获取,并在DevEcoStudio中替换,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md)。 -5. 本示例使用了system_core级别的权限(相关权限级别请查看[权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md) ),需要手动配置高级别的权限签名(具体操作可查看[自动化签名方案](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/hapsigntool-overview.md/) ) 。 +5. 本示例使用了system_core级别的权限(相关权限级别请查看[权限定义列表](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md) ),需要手动配置高级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md))。 ### 下载 diff --git a/code/SystemFeature/DeviceManagement/StorageStatistic/entry/src/main/ets/common/QueryStorageData.ets b/code/SystemFeature/DeviceManagement/StorageStatistic/entry/src/main/ets/common/QueryStorageData.ets index 1d781a70cd284f5785f05ece830e131607976046..434d77fc5daa1fdf59c4ee27907462d06d8db2cd 100644 --- a/code/SystemFeature/DeviceManagement/StorageStatistic/entry/src/main/ets/common/QueryStorageData.ets +++ b/code/SystemFeature/DeviceManagement/StorageStatistic/entry/src/main/ets/common/QueryStorageData.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -126,22 +126,28 @@ export class QueryStorageData { private async getAppNameSync(labelId: number, bundleName: string, appName: string): Promise { if (CheckEmptyUtils.isEmpty(labelId) || labelId <= 0 || CheckEmptyUtils.checkStrIsEmpty(bundleName)) { - Logger.info(TAG, `getAppNameSync param empty! appName: ${appName}`) - return appName + Logger.info(TAG, `getAppNameSync param empty! appName: ${appName}`); + return bundleName; } else { - let cacheKey = labelId + bundleName - Logger.info(TAG, `getAppNameSync getResourceManager cacheKey: ${cacheKey}`) + let cacheKey = labelId + bundleName; + Logger.info(TAG, `getAppNameSync getResourceManager cacheKey: ${cacheKey}`); if (this.isResourceManagerEmpty()) { - Logger.info(TAG, 'getAppNameSync resourceManager is empty') - return appName + Logger.info(TAG, 'getAppNameSync resourceManager is empty'); + return bundleName; } - let bundleContext: Context = this.context.createBundleContext(bundleName) - let resMgrName: string = await bundleContext.resourceManager.getString(labelId) - Logger.info(TAG, `getAppNameSync resMgrName: ${resMgrName}`) - if (resMgrName != null) { - return resMgrName + let resMgrName: string = ''; + try { + let bundleContext: Context = this.context.createBundleContext(bundleName); + resMgrName = bundleContext.resourceManager.getStringSync(labelId); + } catch (err) { + Logger.error(TAG, `getAppNameSync error: ${JSON.stringify(err)}`); + } + + Logger.info(TAG, `getAppNameSync resMgrName: ${resMgrName}`); + if (resMgrName != '') { + return resMgrName; } else { - return appName + return bundleName; } } } diff --git a/code/SystemFeature/Security/CertificateFramework/README_zh.md b/code/SystemFeature/Security/CertificateFramework/README_zh.md index fca384b70f1ca75bb7bface546f3bb985849022f..817ec64cbfd700ddd7b80bea89f9eaceb31f620d 100644 --- a/code/SystemFeature/Security/CertificateFramework/README_zh.md +++ b/code/SystemFeature/Security/CertificateFramework/README_zh.md @@ -2,7 +2,7 @@ ### 介绍 -本示例使用了[@ohos.security.cert](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)相关接口实现了对签名数据进行校验的功能。 +本示例使用了[@ohos.security.cert](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-device-certificate-kit/js-apis-cert.md)相关接口实现了对签名数据进行校验的功能。 实现场景(一)如下: @@ -68,12 +68,12 @@ entry/src/main/ets/ 场景(一) * 使用证书公钥实现签名校验的功能接口Verify封装在CertFrameworkModel中 - * 获取证书公钥:首先调用[cert.createX509Cert](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md#cryptocertcreatex509cert)接口生成证书对象certObject,使用certObject对象的[getPublicKey](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md#getpublickey)能力获取公钥pubKey;然后调用[cryptoFramework.createAsyKeyGenerator](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cryptoFramework.md#cryptoframeworkcreateasykeygenerator)接口创建密钥生成器keyGenerator,使用keyGenerator的[convertKey](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cryptoFramework.md#convertkey-1)能力将公钥pubKey转换为正确的格式。 - * 使用公钥校验签名:首先调用[cryptoFramework.createVerify](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cryptoFramework.md#cryptoframeworkcreateverify)接口创建验签对象verifier,使用公钥pubKey对验签对象verifier进行初始化[verifier.init](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cryptoFramework.md#init-6);然后使用验签对象verifier的[verify](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cryptoFramework.md#verify-1)能力对签名进行校验。 + * 获取证书公钥:首先调用[cert.createX509Cert](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-device-certificate-kit/js-apis-cert.md#certcreatex509cert)接口生成证书对象certObject,使用certObject对象的[getPublicKey](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-device-certificate-kit/js-apis-cert.md#getpublickey)能力获取公钥pubKey;然后调用[cryptoFramework.createAsyKeyGenerator](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-crypto-architecture-kit/js-apis-cryptoFramework.md#cryptoframeworkcreateasykeygenerator)接口创建密钥生成器keyGenerator,使用keyGenerator的[convertKey](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-crypto-architecture-kit/js-apis-cryptoFramework.md#convertkey)能力将公钥pubKey转换为正确的格式。 + * 使用公钥校验签名:首先调用[cryptoFramework.createVerify](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-crypto-architecture-kit/js-apis-cryptoFramework.md#cryptoframeworkcreateverify)接口创建验签对象verifier,使用公钥pubKey对验签对象verifier进行初始化[verifier.init](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-crypto-architecture-kit/js-apis-cryptoFramework.md#init-4);然后使用验签对象verifier的[verify](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-crypto-architecture-kit/js-apis-cryptoFramework.md#verify)能力对签名进行校验。 场景(二) * 使用证书公钥实现签名校验的功能接口validate封装在CertChainModel中 - * 创建证书链: 调用[cert.createX509CertChain](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md)接口生成证书链对象certChainObject。 + * 创建证书链: 调用[cert.createX509CertChain](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-device-certificate-kit/js-apis-cert.md#certcreatex509certchain11)接口生成证书链对象certChainObject。 * 验证证书链: 从根证书中获取校验参数,然后使用certChainObject对象中的validate能力来对证书链进行验证。 ### 相关权限 @@ -82,7 +82,7 @@ entry/src/main/ets/ ### 依赖 -* 加解密算法库框架[@ohos.security.cryptoFramework](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cryptoFramework.md#ohossecuritycryptoframework-%E5%8A%A0%E8%A7%A3%E5%AF%86%E7%AE%97%E6%B3%95%E5%BA%93%E6%A1%86%E6%9E%B6) +* 加解密算法库框架[@ohos.security.cryptoFramework](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-crypto-architecture-kit/js-apis-cryptoFramework.md) ### 约束与限制 @@ -98,7 +98,7 @@ entry/src/main/ets/ ### 下载 - 如需单独下载本工程,执行如下命令: +如需单独下载本工程,执行如下命令: ``` git init diff --git a/code/SystemFeature/Security/DLP/README_zh.md b/code/SystemFeature/Security/DLP/README_zh.md index 66150d1ab30674cfdbe3aa931e7518ef1746e613..5cfac795f162505def2a5f9113a93aa547b9e0c6 100644 --- a/code/SystemFeature/Security/DLP/README_zh.md +++ b/code/SystemFeature/Security/DLP/README_zh.md @@ -40,10 +40,6 @@ entry/src/main/ets/ ### 相关权限 -允许应用读取用户外部存储中的媒体文件信息:[ohos.permission.READ_MEDIA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionread_media) - -允许应用读写用户外部存储中的媒体文件信息:[ohos.permission.WRITE_MEDIA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissionwrite_media) - 允许文件管理类应用通过FAF框架访问公共数据文件:[ohos.permission.FILE_ACCESS_MANAGER](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionfile_access_manager) 允许应用调用storage manager服务中对空间统计以及卷信息的查询接口:[ohos.permission.STORAGE_MANAGER](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionstorage_manager) diff --git a/code/SystemFeature/Security/DLP/entry/src/main/ets/entryability/EntryAbility.ts b/code/SystemFeature/Security/DLP/entry/src/main/ets/entryability/EntryAbility.ts index 619705205b50a3c48a642f8347e466b2abd282db..2d09298881e772d96de6de1892ea98e02e6d2f93 100644 --- a/code/SystemFeature/Security/DLP/entry/src/main/ets/entryability/EntryAbility.ts +++ b/code/SystemFeature/Security/DLP/entry/src/main/ets/entryability/EntryAbility.ts @@ -31,8 +31,6 @@ class TestDlpFileInfo { export default class EntryAbility extends UIAbility { onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { let permissions: Array = [ - 'ohos.permission.READ_MEDIA', - 'ohos.permission.WRITE_MEDIA', 'ohos.permission.FILE_ACCESS_MANAGER', 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED', 'ohos.permission.ACCESS_DLP_FILE', diff --git a/code/SystemFeature/Security/DLP/entry/src/main/ets/feature/DlpManager.ets b/code/SystemFeature/Security/DLP/entry/src/main/ets/feature/DlpManager.ets index 02fc9b2dd620151456211ec71a8a9f4a9549746d..52a4c548d932d1f74bedc78a1b15196e8f745aa3 100644 --- a/code/SystemFeature/Security/DLP/entry/src/main/ets/feature/DlpManager.ets +++ b/code/SystemFeature/Security/DLP/entry/src/main/ets/feature/DlpManager.ets @@ -112,7 +112,6 @@ export class DlpManager { // 帐号登录 async AccountLogin(accountName: string) { Logger.info('AccountLogin start'); - await this.AccountLogout(); let info: UserInfo = { name: '', id: '1234', @@ -170,7 +169,7 @@ export class DlpManager { this.accountInfo = await this.getOsAccountInfo(); let property: dlpPermission.DLPProperty = { 'ownerAccount': this.accountInfo.distributedInfo.name, - 'ownerAccountID': this.accountInfo.distributedInfo.id, + 'ownerAccountID': this.accountInfo.distributedInfo.name, 'ownerAccountType': dlpPermission.AccountType.CLOUD_ACCOUNT, 'authUserList': userList, 'contactAccount': this.accountInfo.distributedInfo.name, diff --git a/code/SystemFeature/Security/DLP/entry/src/main/ets/pages/Index.ets b/code/SystemFeature/Security/DLP/entry/src/main/ets/pages/Index.ets index 3083c4f661278edbe32c8b07ed624cba622d6dd9..8930dd08529775dddb5e1030f68b7c7b0a1e56e9 100644 --- a/code/SystemFeature/Security/DLP/entry/src/main/ets/pages/Index.ets +++ b/code/SystemFeature/Security/DLP/entry/src/main/ets/pages/Index.ets @@ -224,6 +224,7 @@ struct FilePicker { .fontWeight(500) .textAlign(TextAlign.Start) .margin({ left: 0, right: 16 }) + .width('50%') } if (!this.itemShowDeleteButton) { diff --git a/code/SystemFeature/Security/DLP/entry/src/main/module.json5 b/code/SystemFeature/Security/DLP/entry/src/main/module.json5 index 9c6ab6fe2f3ddd7d7a07e967263e974a8f03a4be..3f54f2c18d57916e88301cf66dbcf2df5f5e10fe 100644 --- a/code/SystemFeature/Security/DLP/entry/src/main/module.json5 +++ b/code/SystemFeature/Security/DLP/entry/src/main/module.json5 @@ -49,12 +49,6 @@ } ], "requestPermissions": [ - { - "name": "ohos.permission.READ_MEDIA", - }, - { - "name": "ohos.permission.WRITE_MEDIA", - }, { "name": "ohos.permission.FILE_ACCESS_MANAGER", }, diff --git a/code/SystemFeature/Security/DLP/screenshots/haps/FileEdit.hap b/code/SystemFeature/Security/DLP/screenshots/haps/FileEdit.hap index 035a5e3cde5a58393207c432595ffb04500bf982..b9b9d72b211e38e25d18b5236b2e97f38555cac6 100644 Binary files a/code/SystemFeature/Security/DLP/screenshots/haps/FileEdit.hap and b/code/SystemFeature/Security/DLP/screenshots/haps/FileEdit.hap differ diff --git a/code/SystemFeature/Security/DLP/screenshots/haps/FileEdit.tgz b/code/SystemFeature/Security/DLP/screenshots/haps/FileEdit.tgz index e88adfefb2658e52cba58d7e23fb8584002fe177..f4de7b27582348dfdace1e553c6f292b4cbb61a7 100644 --- a/code/SystemFeature/Security/DLP/screenshots/haps/FileEdit.tgz +++ b/code/SystemFeature/Security/DLP/screenshots/haps/FileEdit.tgz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bd8af7a0c540d5bec5dfa23d0927a65f0187c971f706d218cac0e7519939ae23 -size 83146 +oid sha256:377ad7ad49327e28ce233da1b10966f1ebd49b3ee29bc947c0f71f08d7648f28 +size 179177 diff --git a/code/SystemFeature/Telephony/Message/README_zh.md b/code/SystemFeature/Telephony/Message/README_zh.md index 06a6e3dc27e3fcf0ad613aa23a3968534c0b5939..5846575ec280700a24edaa17d4d5df6bd1383444 100644 --- a/code/SystemFeature/Telephony/Message/README_zh.md +++ b/code/SystemFeature/Telephony/Message/README_zh.md @@ -38,13 +38,13 @@ entry/src/main/ets/ ### 具体实现 + 发送短信功能在SmsModel中,源码参考 [SmsModel.ets](entry/src/main/ets/model/SmsModel.ets) : - + 发送短信:发送短信首先需要使用createMessage方法创建短信实例,然后获取基本参数,getDefaultSmsSlotId可以获取发短信默认卡槽id,getSmscAddr获取短信发送地址,然后调用sms.sendMessage方法发送短信。 + + 发送短信:发送短信首先需要使用createMessage方法创建短信实例,然后获取基本参数,getDefaultSmsSlotId可以获取发短信默认卡槽id,getSmscAddr获取短信发送地址,然后调用sms.sendMessage方法发送短信。 ### 相关权限 -[ohos.permission.SEND_MESSAGES](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionsend_messages) +[ohos.permission.SEND_MESSAGES](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionsend_messages) -[ohos.permission.SET_TELEPHONY_STATE](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionset_telephony_state) +[ohos.permission.SET_TELEPHONY_STATE](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md#ohospermissionset_telephony_state) ### 依赖 @@ -55,9 +55,9 @@ entry/src/main/ets/ 1. 本示例仅支持在标准系统上运行; 2. 本示例需要插入SIM卡,目前该功能仅支持部分机型; 3. 本示例已适配API version 9版本SDK,版本号:3.2.11.9; -4. 本示例涉及使用系统接口:getSmscAddr(),需要手动替换Full SDK 才能编译通过,具体操作可参考[替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/); +4. 本示例涉及使用系统接口:getSmscAddr(),需要手动替换Full SDK 才能编译通过,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/faqs/full-sdk-switch-guide.md/); 5. 本示例需要使用DevEco Studio 3.1 Beta2 (Build Version: 3.1.0.400, built on April 7, 2023)及以上版本才可编译运行; -6. 本示例所配置的权限ohos.permission.SEND_MESSAGES、ohos.permission.SET_TELEPHONY_STATE、ohos.permission.GET_TELEPHONY_STATE为system_basic级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md) 查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/hapsigntool-overview.md/); +6. 本示例所配置的权限ohos.permission.SEND_MESSAGES、ohos.permission.SET_TELEPHONY_STATE、ohos.permission.GET_TELEPHONY_STATE为system_basic级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/AccessToken/permissions-for-system-apps.md) 查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0.1-Release/zh-cn/application-dev/security/hapsigntool-overview.md/); 7. 本示例为预置应用,无需用户授权弹窗,授权方式为预置授权。 ### 下载